[thelist] [php] bounced php mail on win2k

Mark Lee leemark at isu.edu
Wed May 5 17:19:24 CDT 2004


Judah McAuley wrote:

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

Can you override sendmail_from in your script, using ini_set()?

like so:

	ini_set('sendmail_from', 'z at c.com');

Then assemble and mail your mail.

More info here:
http://www.php.net/manual/en/function.ini-set.php

Mark


More information about the thelist mailing list