Hello ALL!
We have PHP 4.3.2 running on a Windows NT4 (SP6) system.
My PHP.INI shows the following lines:
[mail function]
; For Win32 only.
SMTP= 192.168.160.4 ; our UNIX machine, running sendmail
; For Win32 only.
sendmail_from= b2b@mycompany.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path=
When I send a message to a wrong email address, the error message returns to sendmail_from address, overwriting the address specified in headers.
Here is my code:
$myemail = "faraco@mycompany.com";
$contactemail = "wrongemail@wronghost.com";
$subject = "sendmail_from test";
$message = "According to this message headers, the From: address is ".$myemail;
$headers = "From: ".$myemail."\r\n";
mail($contactemail, $subject, $message, $headers);
After running this script, the error message is returned to "b2b@mycompany.com".
But it should be delivered to "faraco@mycompany.com", shouldn't it?