Problem w/ 'From' address using PHP's mail() & IIS 6.0

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Astryk
Forum Newbie
Posts: 2
Joined: Tue Sep 13, 2005 11:40 am

Problem w/ 'From' address using PHP's mail() & IIS 6.0

Post by Astryk »

On a Windows 2003 server using IIS and the built-in SMTP server, I get the error "Warning: mail(): SMTP server response: 501 5.5.4 Invalid Address" from the following code:

$to = 'my@address.com';
$subject = 'Testing';
$message = 'This is a test message';
$headers = 'From: Testing <just@testing.com>' . "\r\n" . 'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);

However, it works fine when I remove the friendly name from the From address and just use:

$headers = 'From: just@testing.com'

Has anybody seen this problem before and/or could anybody try and help me solve it?

Thx
Astryk
Forum Newbie
Posts: 2
Joined: Tue Sep 13, 2005 11:40 am

Post by Astryk »

Here's some additional info. If I telnet into the SMTP server I can send messages fine when I include the friendly name in the DATA portion [From: "Me" <my@address.com>], so it seems that the problem has something to do with the way in which the PHP mail() function is interacting with it. What continues to be strange, however, is that an identically configured IIS/SMTP server with the friendly name included in the mail() call works fine on a Windows 2000 Server machine. My first reaction is to think that Microsoft stopped supporting something in 2003 that they did in 2000 but if that were the case there should have been a lot more people with the same complaint out there on the net. In any case, additional thoughts would be greatly appreciated.
Post Reply