mail() Getting An Email To Go Through

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm messing with the mail() function trying to get some email

I managed to get the email through yesterday, and perhaps
the mail server is slow delivering.

function SendSomeEmailOut() {
// bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )
$sToAddr = "";
$sEmailSubject = "Sample Subject";
$sEmailBody = "Sample Body";
$yResults = mail($sToAddr, $sEmailSubject, $sEmailBody, $sFromAddr);

$yResults always comes back as true.

Any suggestions are greatly appreciated. Thanks.

Jim Carlock
Post replies to the group.

Re: mail() Getting An Email To Go Through

Jim Carlock wrote:

Quoted text here. Click to load it

Your "From" header is malformed.  In fact, it's really not a header at all;
the line looks like this:

when it should look like this:

So, basically, you need to add the "From: " and take the single quotes out
of the e-mail address.  I'm not sure whether this will solve your problem,
but it could certainly be creating issues.

Benjamin D. Esham  |  AIM: bdesham128  |  Jabber: same as e-mail
"Anyone entrusted with power will abuse it if not also animated
with the love of truth and virtue, no matter whether he be a
prince, or one of the people."             — Jean de La Fontaine

Site Timeline