Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to get my server to be able to send email from PHP. Currently it is using send mail, but whenever I try to send mail to a gmail address I get this sort of response:

Content-Type: message/delivery-status

Reporting-MTA: dns; ServerName
Received-From-MTA: DNS; localhost
Arrival-Date: Fri, 4 Jun 2010 22:52:38 GMT

Final-Recipient: RFC822;
Action: failed
Status: 5.7.1
Remote-MTA: DNS;
Diagnostic-Code: SMTP; 550-5.7.1 [] The IP you're using to send mail is not authorized
Last-Attempt-Date: Fri, 4 Jun 2010 22:52:39 GMT

How can I set this up to relay through a google account that I own? Is sendmail the best thing to use, or should I switch to Postfix or something? This is on an Ubuntu Server 9.10

share|improve this question
up vote 1 down vote accepted

Your server address may be listed as a dynamic address, which should never be sending email into the Internet directly. The standards provide of a layer of trust and require static addresses with correct rDNS configuration. Almost all the spam I get comes from dynamic addresses.

You should setup your server to send outgoing emails via your ISPs SMTP server. You can use Gmail as your relay, but you will need to enable SMTP services on your Gmail account. Then you will need to configure Postfix to authenticate when connection to Gmail.

share|improve this answer

If I remember correctly, you can't relay through gmail, even using your own credentials.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.