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

Wyck

Senior member
Jun 13, 2001
940
1
0
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
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
You sure it's the friendly name and nothing to do with the X-Mailer line? Shouldn't "\n" be sufficient for a new line when running on windows?