Re: a PHP/mail question

From: Ed Summers <ehs_at_nyob>
Date: Mon, 5 Jan 2004 14:24:10 -0600
To: CODE4LIB_at_LISTSERV.ND.EDU
On Mon, Jan 05, 2004 at 03:08:14PM -0500, Kenneth R. Irwin wrote:
> $mailTo = "kirwin_at_wittenberg.edu";
> $mailSubject = "php mail test";
> $mailBody = "does this work?";
> $mailHeaders = "From: yourmom_at_yourmom.com";
>
> if( mail($mailTo, $mailSubject, $mailBody, $mailHeaders))
> {
>   print "Mail successfully sent to $mailTo.";
> }
> else { print "Mail could not be sent to $mailTo."; }

I think you may need a \r\n in the headers portion.

    $mailHeaders = "From: yourmom_at_yourmom.com\r\n";

PHP's mail() function is a wrapper around Sendmail. Are you certain that
your new server has sendmail available? More details on the environment
settings that control Sendmail can be found here:

     http://www.php.net/manual/en/ref.mail.php

//Ed
Received on Mon Jan 05 2004 - 15:30:32 EST