[thelist] [php] bounced php mail on win2k
Judah McAuley
judah at wiredotter.com
Wed May 5 16:58:00 CDT 2004
Anthony Baratta wrote:
> Which PHP function are you using? Does it have any overrides for the
> default behaviour?
Just using the built in mail() function. The function takes: mail($to,
$subject, $message, $headers)
Slightly modified from the PHP docs, I'm testing with this (of course
using real addresses):
/* recipients */
$to = "y at b.com";
/* subject */
$subject = "Birthday Reminders for August";
/* message */
$message = '
Blah Blah Blah
';
/* additional headers */
$headers = "To: Judah <y at b.com>\r\n";
$headers .= "From: Other Judah <z at c.com>\r\n";
$headers .= "Reply-To: <z at c.com>\r\n";
$headers .= "Return-Path: <z at c.com>\r\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
My php.ini file has these relevant portions:
[mail function]
; For Win32 only.
SMTP = a.com ; for Win32 only
; For Win32 only.
sendmail_from = x at a.com ; for Win32 only
It seems that on Win32, the sendmail_from value in the php.ini file
overrides anything that you might send as additional headers in your
mail() function.
Judah
More information about the thelist
mailing list