note 59752 added to ref.mail
| From: | aweather88 at gmail dot com | Date: | Wed, 14 Dec 2005 22:45:56 +0000 |
| Subject: | note 59752 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100165@lists.php.net to get a copy of this message | ||
I spent hours searching the web trying to figure out why I was getting a "WARNING: mail(): SMTP
server response: 501 5.5.4 Invalid Address " every time I was using the mail() function on my
server (Win2K3,IIS 6.0,PHP4.4.1). I knew everything was setup properly for SMTP based on other non
IIS 6.0 configurations.
Turns out that the IIS 6.0 SMTP service does not like formatting of the "From" field in
mail headers. For instance:
<?PHP
//This line DOES NOT send mail message correctly
$headers .= "From: \"".$fromname."\"
<".$fromaddress.">\n";
?>
However this works:
<?PHP
//This line sends mail message correctly
$headers .= "From: \"".$fromaddress."\"\n";
?>
The fix is in Microsoft Article ID 291828 ( http://support.microsoft.com/?id=291828 ). Even
though the "bug" workaround is for IIS 6.0 on Exchange 2003 communicating with a UNIX
server, THIS SOLVES THE PROBLEM. Just skip down to the last section for Exchange 2003 and follow
the instructions to modify the IIS 6 MetaBase with the MetaBase Explorer found in the IIS 6 Resource
Kit.
----
Manual Page -- http://www.php.net/manual/en/ref.mail.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59752
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59752&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59752&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59752&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59752&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59752&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59752&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59752&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59752&report=yes
Search -- http://master.php.net/manage/user-notes.php