Hi all,
We have been using the PHP mail function for several years with no issues.
We run Apache, PHP, MySQL, fyi.
We changed IP addresses for our 2 servers at our ISP (one a mail server, and the other the VM hosting our site). We have done this in the past with no issues, and now, it is not letting me send unless the To: address is the one authenticated on the mail server. (which is useless, since then I can only send to myself).
I changed the php.ini as follows:
[mail function]
; For Win32 only.
;SMTP = localhost
; old address before the switch
;SMTP = xxx.xxx.94.34
;new address after the switch
SMTP = xxx.xxx.94.111
smtp_port = 25
; For Win32 only.
;sendmail_from = ; For Win32 only.
;this address did not change and is authenticated on the Exchange server to allow relaying
sendmail_from = support@xxx.com
I tried this as a test:
$to = 'don@xxx.com';
$subject = 'test email';
$message = 'Did it work?';
$headers = 'From: support@xxx.com' . "\r\n" .
'Reply-To: support@xxx.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
And I get the standard relay error:
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for don....
The only way I can get it to work is to switch the To: and From: and it will successfully send. But it goes to my support account from my support and puts the "From:address" in the body copy?
I am at a loss, and our ISP and techs triple checked all the firewall rules and the SMTP settings on the Exchange server (and the Exchange server only had the IP address changed made).
We have tried email apps, and use one for mailing to our customers, but it is not an option for simple sends, like a password reset (which uses this email function, but will not work any longer).
Anyone have any guidance on this, or seen this before.
I appreciate the assistance,
Don