On 14 Jul 2011, at 20:51, SM wrote:
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
Thanks!
I think that's close to where I am now. I'm using PHPMailer (rather
than the basic Mail class). I set the parameters:
$mail->SetFrom ('[email protected]', 'Sending
Service');
$mail->AddReplyTo ($email_sender, $email_sender_realname);
$mail->AddAddress ($email_recipient, $email_recipient_realname);
However, during testing, my email client (Apple Mail) puts both
example.org.uk and $email_sender in the reply-to line - which I think
is a little messy. Have I misconfigured PHPMailer? is this a quirk of
Apple Mail? or is this the norm?
Simon
_______________________________________________
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