468,249 Members | 1,473 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

mail() Getting An Email To Go Through

I'm messing with the mail() function trying to get some email
through.

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 = "so*****@example.com";
$sFromAddr = "Some One Else <'s**********@example.com'>";
$sEmailSubject = "Sample Subject";
$sEmailBody = "Sample Body";
$yResults = mail($sToAddr, $sEmailSubject, $sEmailBody, $sFromAddr);
return($yResults);
}

$yResults always comes back as true.

Any suggestions are greatly appreciated. Thanks.

--
Jim Carlock
Post replies to the group.

Sep 3 '06 #1
1 908
Jim Carlock wrote:
I'm messing with the mail() function trying to get some email through.

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

$sFromAddr = "Some One Else <'s**********@example.com'>";

$yResults = mail($sToAddr, $sEmailSubject, $sEmailBody, $sFromAddr);
Your "From" header is malformed. In fact, it's really not a header at all;
the line looks like this:

Some One Else <'s**********@example.com'>

when it should look like this:

From: Some One Else <so*********@example.com>

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.

HTH,
--
Benjamin D. Esham
bd*****@gmail.com | 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
Sep 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Kevin Knorpp | last post: by
34 posts views Thread by antonyliu2002 | last post: by
6 posts views Thread by jerrygarciuh | last post: by
8 posts views Thread by Robert Dufour | last post: by
11 posts views Thread by justsome_newbie | last post: by
12 posts views Thread by e_matthes | last post: by
maliksleo
1 post views Thread by maliksleo | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.