I have a Win2K3 machine with IIS 6.0, PHP 4.4.1, and iDesk 1.0. There was a problem with the iDeesk email being handed off to the local SMTP service for delivery... there was no mail flowing. Actually, this is not an iDesk problem but a problem with the way the PHP mail() funtion interacts with the IIS 6.0 SMTP service.
I found this bug by testing a simple mail function in efforts to degug the iDesk problem. I was getting a "WARNING: mail(): SMTP server response: 501 5.5.4 Invalid Address " every time I was using the mail() function. I found that when setting the "From" header, IIS rejected the mail if there was a "From name". For instance:
However this works:PHP Code://This line DOES NOT send mail message correctly
$headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";
Weird, but I tracked down a similar issue with IIS 6.0 and applied the suggested Microsoft fix. The fix wrorked and mail began flowing!PHP Code://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.


