Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

[Asked this on stackoverflow and was referred here]

We are developing a custom web app for a client. This app is on a separate server,, than the client's web site, Each user of our app has an email address like,, etc. The client is using Google Apps for business for their user emails (like

Now here's what we need: Each user needs to be able to send certain emails to people on his contact list. Those emails are from our box, But we want the From and Reply-To address to be the user who sent it, e.g.,

How can we set up our box,, to be an authorized sender of emails from ""? I looked up the SPF record for Google apps, and it is:

v=spf1 ~all

(1) How do we add "" to this SPF record?

(2) From PHP, how can we ensure that the email, while sent from our, still says "From:"?


share|improve this question
v=spf1 ~all

That allows the device(s) that resolves to.

PHP builds the message envelope completely independently of the hostname of the device that it's sent from. Set the headers correctly in your code, the SMTP relay that it comes from is of no significance for the apparent sender.

share|improve this answer
That is very simple. Awesome, thanks. – royappa Oct 21 '11 at 11:30

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.