ME020587 - TRB: Messages sent via PHP script are rejected by remote servers.


SYMPTOMS

The following example error will be logged within the MailEnable SMTP log files when sending via a PHP script using the send mail function.

MAIL FROM:<My Name <myemail@mydomain.com> SIZE=698

550 5.1.2 Sender rejected.

CAUSE

This is because the PHP mail function has not been configured to use the "additional parameters" to set the envelope sender of the message. If additional parameters within the PHP mail function are not specified then the message FROM header within the message will be used during the SMTP conversation which it most cases is not suitable since it may contain more than just the email address. If the message FROM header contains a friendly name it will use this within the SMTP conversation FROM command and embrace the friendly name and SMTP address within <> brackets which violates the RFC standard.

RESOLUTION

The following PHP example shows the additional parameter within the PHP mail function that can be used as reference:

<?php mail("nobody@example.com", "the subject", $message, "From: myemail@mydomain.com", "-fmyemail@mydomain.com"); ?> 

REFERENCES

PHP: http://php.net/manual/en/function.mail.php

 



Product:MailEnable (All Versions)
Category:Other
Module:General
Keywords:php script 550 mail from function
Class:TRB: Troubleshooting (Configuration or Environment)
Revised:Wednesday, May 4, 2016
Author:
Publisher:MailEnable