NYCPHP Meetup

NYPHP.org

[nycphp-talk] Mail Headers Malformed???

Joseph Crawford codebowl at gmail.com
Sat May 21 10:51:46 EDT 2005


Hello everyone.

i have a site i am developing on my windows machine and i keep getting this 
error when calling the mail() function


*Warning*: mail()
[function.mail<http://codebowl.homelinux.net:8001/clients/JVMedia/SimonVolkov/function.mail>]:
"sendmail_from" not set in php.ini or custom "From:" header missing in *
D:\clients\JVMedia\Simonvolkov\System\Email\Mailer.class.php* on line *97*

The problem could be simply solved by me setting my sendmail_from in my 
php.ini, however what if i was in a shared environment, something fishy 
here.

here are my headers in code

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'To: '.$mail['fname'].' '.$mail['lname'].' <'.$mail['email'].'>' 
. "\r\n";
$headers .= 'From: "Simon Volkov Newsletters" 
<'.Application::Configuration()->NewsletterFromEmail().'>' . "\r\n";

and here are my headers printed out

MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
To: Joseph Crawford <codebowl at gmail.com <http://gmail.com>>
From: Simon Volkov Newsletters <newsletters at svolkov.com <http://svolkov.com>>

Here is my actual mail function call

mail($mail['email'], $mail['subject'], $mail['body'], $headers);


Is there something obvious that i am doing wrong here? I think my headers 
must be malformed because php doesnt see a good custom From header in the 
specified headers it falls back to the php.ini setting (which i have 
commented out)

Any help would be appreciated.

-- 
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20050521/b74adb22/attachment.html>


More information about the talk mailing list