Hi Simon,
At 11:54 14-07-2011, simon haywood wrote:
But now I have a problem.

My plan was to have the site email the appropriate MP setting the
"from" and "reply to" headers to be the email address of the user. In
fact, it's been working fine in this way during our test phase - using
my own SMTP server. I want to do it this way, because it means the
user gets the auto-reply, and subsequent response from the MP.

The following code snippet is untested:

$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n";

mail($to, $subject, $message, $headers);

The user on behalf of whom you are sending the message ([email protected]) will not get any bounces. Such notifications are sent to the sender. That might be different from the "From:" in the message headers. There shouldn't be any SPF or DKIM issues with the above.

Regards,
-sm



_______________________________________________
developers-public mailing list
[email protected]
https://secure.mysociety.org/admin/lists/mailman/listinfo/developers-public

Unsubscribe: 
https://secure.mysociety.org/admin/lists/mailman/options/developers-public/archive%40mail-archive.com

Reply via email to