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
$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