Forum Moderators: coopster
"Sender" has to be included in the headers to work around certain service providers blocking web-generated mail that looks suspicious, so it is set (for all messages) to "server@example-a.com". If "Sender" is left out, auto-responders will go to customer@example-c.com", but there is a chance of the message being blocked by some ISPs.
I have a problem with auto-responders and failure notifications being sent to "server@example-a.com" instead of "customer@example-c.com" who originally sent the message. Is there any way to get auto-replies and other automatic notifications to go to the *person* that sent the message instead of the *website/server*?
Code looks something like this:
<?php
$sendmail = "PATH/TO/SENDMAIL -t -f server@example-a.com";
$m = popen($sendmail, "w");
fputs($m, 'To: recipient@example-b.com'."\r\n");
fputs($m, 'Return-Path: server@example-a.com'."\r\n");
fputs($m, 'Sender: server@example-a.com'."\r\n");
fputs($m, 'From: "customer" <customer@example-c.com>'."\r\n");
fputs($m, 'Reply-To: customer@example-c.com'."\r\n");
fputs($m, 'Subject: Test Message ('.time().')'."\r\n");
fputs($m, "\r\n");
fputs($m, 'This is another test message.'."\r\n");
fputs($m, "\r\n");
pclose($m);
?> [edited by: jatar_k at 2:41 pm (utc) on Sep. 18, 2008]
I realize that it does look a bit spammy, but it's been working perfectly for years until service providers have updated their spam policies. Now I've had to make some updates (including "sender") that's caused this issue to arise.