Connecting Tech Pros Worldwide Forums | Help | Site Map

Why PHP Mail Not Sent

Vic Spainhower
Guest
 
Posts: n/a
#1: Jan 13 '06
Hello,

Is there any way to determine why a PHP mail message is not delivered? I
have a particular user who is not receiving mail from my PHP application and
I don't know why, it just totally disappears. Using the following test did
not work either.


$to = 'gladys@herwebsite.com';
$subject = 'Wakeup Gladys!';
$message = '<b>yo</b>, whassup?';
$headers = "From: vic@mywebsite.com\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";


Thanks for any help received!

Vic



Andy Hassall
Guest
 
Posts: n/a
#2: Jan 13 '06

re: Why PHP Mail Not Sent


On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.com> wrote:
[color=blue]
>Is there any way to determine why a PHP mail message is not delivered? I
>have a particular user who is not receiving mail from my PHP application and
>I don't know why, it just totally disappears. Using the following test did
>not work either.
>
> $to = 'gladys@herwebsite.com';
> $subject = 'Wakeup Gladys!';
> $message = '<b>yo</b>, whassup?';
> $headers = "From: vic@mywebsite.com\r\n" .
> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
> "MIME-Version: 1.0\r\n" .
> "Content-Type: text/html; charset=utf-8\r\n" .
> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]

Presumably there's a call to mail() as well ;-)

How much access to mailserver logs on both sides do you have? First place I'd
look is /var/log/maillog (or equivalent) at least on the sending system to make
sure it's going out, and then on the receiving end to see if it arrived but was
subsequently zapped by spam filters.

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Vic Spainhower
Guest
 
Posts: n/a
#3: Jan 14 '06

re: Why PHP Mail Not Sent


Andy,

oops - yes I am making a call to the mail function:

$success = mail($to, $subject, $message, $headers);

Now, this is running on a Windows Host so would the mail logs be created
automatically and would I need to check with the ISP as to the location or
is this defined in the php.ini file?

Vic



"Andy Hassall" <andy@andyh.co.uk> wrote in message
news:o5egs19bk7gu3qj245ha3f8kn3om0iid7h@4ax.com...[color=blue]
> On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.com>
> wrote:
>[color=green]
>>Is there any way to determine why a PHP mail message is not delivered? I
>>have a particular user who is not receiving mail from my PHP application
>>and
>>I don't know why, it just totally disappears. Using the following test did
>>not work either.
>>
>> $to = 'gladys@herwebsite.com';
>> $subject = 'Wakeup Gladys!';
>> $message = '<b>yo</b>, whassup?';
>> $headers = "From: vic@mywebsite.com\r\n" .
>> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
>> "MIME-Version: 1.0\r\n" .
>> "Content-Type: text/html; charset=utf-8\r\n" .
>> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
>
> Presumably there's a call to mail() as well ;-)
>
> How much access to mailserver logs on both sides do you have? First place
> I'd
> look is /var/log/maillog (or equivalent) at least on the sending system to
> make
> sure it's going out, and then on the receiving end to see if it arrived
> but was
> subsequently zapped by spam filters.
>
> --
> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool[/color]


Andy Hassall
Guest
 
Posts: n/a
#4: Jan 14 '06

re: Why PHP Mail Not Sent


On Fri, 13 Jan 2006 15:45:51 -0800, "Vic Spainhower" <vic@showsec.com> wrote:
[color=blue]
>Now, this is running on a Windows Host so would the mail logs be created
>automatically and would I need to check with the ISP as to the location or
>is this defined in the php.ini file?[/color]

You'd need to check with the ISP. It's not to do with PHP, I'm thinking of the
logs that the mail server itself generates (at least on UNIX-based systems).

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jim Michaels
Guest
 
Posts: n/a
#5: Jan 15 '06

re: Why PHP Mail Not Sent


I noticed that my web mail on yahoo will filter out emails sent from PHP
into the Bulk Mail folder automatially. I've tried everything to fx that,
even setting the Return-Path:, but the resulting email had a different
Return-Path than what I set. I think the mail server mangled it. I don't
think it was PHP because PHP doesn't have a setting for that.

"Andy Hassall" <andy@andyh.co.uk> wrote in message
news:o5egs19bk7gu3qj245ha3f8kn3om0iid7h@4ax.com...[color=blue]
> On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.com>
> wrote:
>[color=green]
>>Is there any way to determine why a PHP mail message is not delivered? I
>>have a particular user who is not receiving mail from my PHP application
>>and
>>I don't know why, it just totally disappears. Using the following test did
>>not work either.
>>
>> $to = 'gladys@herwebsite.com';
>> $subject = 'Wakeup Gladys!';
>> $message = '<b>yo</b>, whassup?';
>> $headers = "From: vic@mywebsite.com\r\n" .
>> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
>> "MIME-Version: 1.0\r\n" .
>> "Content-Type: text/html; charset=utf-8\r\n" .
>> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
>
> Presumably there's a call to mail() as well ;-)
>
> How much access to mailserver logs on both sides do you have? First place
> I'd
> look is /var/log/maillog (or equivalent) at least on the sending system to
> make
> sure it's going out, and then on the receiving end to see if it arrived
> but was
> subsequently zapped by spam filters.
>
> --
> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool[/color]


Philip Ronan
Guest
 
Posts: n/a
#6: Jan 15 '06

re: Why PHP Mail Not Sent


Vic Spainhower wrote:
[color=blue]
> Hello,
>
> Is there any way to determine why a PHP mail message is not delivered? I
> have a particular user who is not receiving mail from my PHP application and
> I don't know why, it just totally disappears. Using the following test did
> not work either.
>
>
> $to = 'gladys@herwebsite.com';
> $subject = 'Wakeup Gladys!';
> $message = '<b>yo</b>, whassup?';
> $headers = "From: vic@mywebsite.com\r\n" .
> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
> "MIME-Version: 1.0\r\n" .
> "Content-Type: text/html; charset=utf-8\r\n" .
> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]

The mail is quite possibly being blackholed by a spam filter because you're
using "\r\n" to separate the mail headers. Use "\n" instead. I know that's
not what it says in RFC822, but that's just how things turned out.

Sending HTML content without any <HTML> tag at the beginning might set a few
alarm bells ringing too. In general you'll have fewer problems if you emulate
the behaviour of regular email software.

Phil

--
philronan [@] blueyonder [dot] co [dot] uk

Vic Spainhower
Guest
 
Posts: n/a
#7: Jan 15 '06

re: Why PHP Mail Not Sent


Phil,

I tried removing the \r but it doesn't help, message still is never
delivered. remains a mystery

Vic


"Philip Ronan" <nobody@example.invalid> wrote in message
news:0001HW.BFEFEF770079E2D1F068C550@news.blueyond er.co.uk...[color=blue]
> Vic Spainhower wrote:
>[color=green]
>> Hello,
>>
>> Is there any way to determine why a PHP mail message is not delivered? I
>> have a particular user who is not receiving mail from my PHP application
>> and
>> I don't know why, it just totally disappears. Using the following test
>> did
>> not work either.
>>
>>
>> $to = 'gladys@herwebsite.com';
>> $subject = 'Wakeup Gladys!';
>> $message = '<b>yo</b>, whassup?';
>> $headers = "From: vic@mywebsite.com\r\n" .
>> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
>> "MIME-Version: 1.0\r\n" .
>> "Content-Type: text/html; charset=utf-8\r\n" .
>> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
>
> The mail is quite possibly being blackholed by a spam filter because
> you're
> using "\r\n" to separate the mail headers. Use "\n" instead. I know that's
> not what it says in RFC822, but that's just how things turned out.
>
> Sending HTML content without any <HTML> tag at the beginning might set a
> few
> alarm bells ringing too. In general you'll have fewer problems if you
> emulate
> the behaviour of regular email software.
>
> Phil
>
> --
> philronan [@] blueyonder [dot] co [dot] uk
>[/color]


Philip Ronan
Guest
 
Posts: n/a
#8: Jan 15 '06

re: Why PHP Mail Not Sent


Vic Spainhower wrote:
[color=blue]
> Phil,
>
> I tried removing the \r but it doesn't help, message still is never
> delivered. remains a mystery
>
> Vic[/color]

Bummer :-(

Try sending to a different address, preferably a mailbox you can access
directly before any spam filtering takes place. If it doesn't get through,
then maybe your server isn't configured properly. If it does get through then
post the headers here so we can have a look (not forgetting to obscure the
email addresses first!).

If your headers are OK and you can send mail to other domains then perhaps
you've been blacklisted for some other reason. Are you emailing from a
virtually hosted site? When you share a server with 500 other websites,
there's a good chance one of them is sending out spam and getting the server
blacklisted. Tiy can check this by running a spam database lookup at
<http://www.dnsstuff.com/> -- just enter your server's IP address and see
what comes back.

--
philronan [@] blueyonder [dot] co [dot] uk

Vic Spainhower
Guest
 
Posts: n/a
#9: Jan 16 '06

re: Why PHP Mail Not Sent


Hi Phil,

I checked the www.dnsstuff.com and the server is not listed. Here are the
headers from the message. I receive the message but Gladys doe not.

Received: from web78.expresstech.net ([199.231.134.14])
by email10.mywebmailserver.com (IntelliMail) with ESMTP id CRY74585
for <vic at dhowsec dot com>; Mon, 16 Jan 2006 09:35:41 -0500
Received: from web78 ([127.0.0.1]) by web78.expresstech.net with Microsoft
SMTPSVC(6.0.3790.211);
Mon, 16 Jan 2006 09:35:21 -0500
Date: Mon, 16 Jan 2006 09:35:21 -0500
Subject: Horse Show entry for ShowMyHorse (Demo Show) ...
To: vic at showsec dot com, gladys at oaksshowservices dot com
From: webmaster at showmyhorse dot com
Content-type: text/plain
x-mailer: PHP/4.3.10
Return-Path: me@localhost.com
Message-ID: <WEB78SeHqwEsX5xyNYh0000feaa@web78.expresstech.net >
X-OriginalArrivalTime: 16 Jan 2006 14:35:21.0359 (UTC)
FILETIME=[1446E1F0:01C61AAA]

Appreciate your help in this ...

Vic



Gordon Burditt
Guest
 
Posts: n/a
#10: Jan 16 '06

re: Why PHP Mail Not Sent


>I checked the www.dnsstuff.com and the server is not listed. Here are the[color=blue]
>headers from the message. I receive the message but Gladys doe not.[/color]

Reasons or dropping this message, used by a lot of servers:
1. The From: line does not contain a valid email address.
2. The To: line contains RFC822 syntax errors
3. The Return-path resolves to an MX server with a private IP address.
[color=blue]
>
>Received: from web78.expresstech.net ([199.231.134.14])
> by email10.mywebmailserver.com (IntelliMail) with ESMTP id CRY74585
> for <vic at dhowsec dot com>; Mon, 16 Jan 2006 09:35:41 -0500
>Received: from web78 ([127.0.0.1]) by web78.expresstech.net with Microsoft
>SMTPSVC(6.0.3790.211);
> Mon, 16 Jan 2006 09:35:21 -0500
>Date: Mon, 16 Jan 2006 09:35:21 -0500
>Subject: Horse Show entry for ShowMyHorse (Demo Show) ...
>To: vic at showsec dot com, gladys at oaksshowservices dot com
>From: webmaster at showmyhorse dot com
>Content-type: text/plain
> x-mailer: PHP/4.3.10
>Return-Path: me@localhost.com
>Message-ID: <WEB78SeHqwEsX5xyNYh0000feaa@web78.expresstech.net >
>X-OriginalArrivalTime: 16 Jan 2006 14:35:21.0359 (UTC)
>FILETIME=[1446E1F0:01C61AAA]
>
>Appreciate your help in this ...
>
>Vic[/color]

Gordon L. Burditt
Vic Spainhower
Guest
 
Posts: n/a
#11: Jan 16 '06

re: Why PHP Mail Not Sent


Jim,

I was able to set the return path in the message header and it does come
through OK. However, it didn't fix the problem with this particular address.

Vic


"Jim Michaels" <jmichae3@yahoo.com> wrote in message
news:pK-dnUgmbM-bgFfenZ2dnUVZ_tadnZ2d@comcast.com...[color=blue]
>I noticed that my web mail on yahoo will filter out emails sent from PHP
>into the Bulk Mail folder automatially. I've tried everything to fx that,
>even setting the Return-Path:, but the resulting email had a different
>Return-Path than what I set. I think the mail server mangled it. I don't
>think it was PHP because PHP doesn't have a setting for that.
>
> "Andy Hassall" <andy@andyh.co.uk> wrote in message
> news:o5egs19bk7gu3qj245ha3f8kn3om0iid7h@4ax.com...[color=green]
>> On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.com>
>> wrote:
>>[color=darkred]
>>>Is there any way to determine why a PHP mail message is not delivered? I
>>>have a particular user who is not receiving mail from my PHP application
>>>and
>>>I don't know why, it just totally disappears. Using the following test
>>>did
>>>not work either.
>>>
>>> $to = 'gladys@herwebsite.com';
>>> $subject = 'Wakeup Gladys!';
>>> $message = '<b>yo</b>, whassup?';
>>> $headers = "From: vic@mywebsite.com\r\n" .
>>> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
>>> "MIME-Version: 1.0\r\n" .
>>> "Content-Type: text/html; charset=utf-8\r\n" .
>>> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
>>
>> Presumably there's a call to mail() as well ;-)
>>
>> How much access to mailserver logs on both sides do you have? First place
>> I'd
>> look is /var/log/maillog (or equivalent) at least on the sending system
>> to make
>> sure it's going out, and then on the receiving end to see if it arrived
>> but was
>> subsequently zapped by spam filters.
>>
>> --
>> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
>> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool[/color]
>
>[/color]


Vic Spainhower
Guest
 
Posts: n/a
#12: Jan 16 '06

re: Why PHP Mail Not Sent


Gordon -

I think SMTP must validate the To: line because I added a \n to the end of the line and received Warning: mail(): SMTP server response: 501 5.5.4 Invalid Address in d:\html\users\176666\showmyhorsecom\html\ShowInfo_ page.php on line 87

I also added a Return-Path with a valid email address and that didn't help either. I know the return-path was included in the headers because I checked my copy of the email and it was there.

Vic


"Gordon Burditt" <gordonb.slagc@burditt.org> wrote in message news:11sniqfeh6fk719@corp.supernews.com...[color=blue][color=green]
> >I checked the www.dnsstuff.com and the server is not listed. Here are the
>>headers from the message. I receive the message but Gladys doe not.[/color]
>
> Reasons or dropping this message, used by a lot of servers:
> 1. The From: line does not contain a valid email address.
> 2. The To: line contains RFC822 syntax errors
> 3. The Return-path resolves to an MX server with a private IP address.
> [color=green]
>>
>>Received: from web78.expresstech.net ([199.231.134.14])
>> by email10.mywebmailserver.com (IntelliMail) with ESMTP id CRY74585
>> for <vic at dhowsec dot com>; Mon, 16 Jan 2006 09:35:41 -0500
>>Received: from web78 ([127.0.0.1]) by web78.expresstech.net with Microsoft
>>SMTPSVC(6.0.3790.211);
>> Mon, 16 Jan 2006 09:35:21 -0500
>>Date: Mon, 16 Jan 2006 09:35:21 -0500
>>Subject: Horse Show entry for ShowMyHorse (Demo Show) ...
>>To: vic at showsec dot com, gladys at oaksshowservices dot com
>>From: webmaster at showmyhorse dot com
>>Content-type: text/plain
>> x-mailer: PHP/4.3.10
>>Return-Path: me@localhost.com
>>Message-ID: <WEB78SeHqwEsX5xyNYh0000feaa@web78.expresstech.net >
>>X-OriginalArrivalTime: 16 Jan 2006 14:35:21.0359 (UTC)
>>FILETIME=[1446E1F0:01C61AAA]
>>
>>Appreciate your help in this ...
>>
>>Vic[/color]
>
> Gordon L. Burditt[/color]
Jim Michaels
Guest
 
Posts: n/a
#13: Jan 24 '06

re: Why PHP Mail Not Sent


this was fixed by my hosting service. they set the sending email address to
an email address on the server I have set up. it *was* set up to some
address everybody was supposed to use.

"Jim Michaels" <jmichae3@yahoo.com> wrote in message
news:pK-dnUgmbM-bgFfenZ2dnUVZ_tadnZ2d@comcast.com...[color=blue]
>I noticed that my web mail on yahoo will filter out emails sent from PHP
>into the Bulk Mail folder automatially. I've tried everything to fx that,
>even setting the Return-Path:, but the resulting email had a different
>Return-Path than what I set. I think the mail server mangled it. I don't
>think it was PHP because PHP doesn't have a setting for that.
>
> "Andy Hassall" <andy@andyh.co.uk> wrote in message
> news:o5egs19bk7gu3qj245ha3f8kn3om0iid7h@4ax.com...[color=green]
>> On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.com>
>> wrote:
>>[color=darkred]
>>>Is there any way to determine why a PHP mail message is not delivered? I
>>>have a particular user who is not receiving mail from my PHP application
>>>and
>>>I don't know why, it just totally disappears. Using the following test
>>>did
>>>not work either.
>>>
>>> $to = 'gladys@herwebsite.com';
>>> $subject = 'Wakeup Gladys!';
>>> $message = '<b>yo</b>, whassup?';
>>> $headers = "From: vic@mywebsite.com\r\n" .
>>> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
>>> "MIME-Version: 1.0\r\n" .
>>> "Content-Type: text/html; charset=utf-8\r\n" .
>>> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
>>
>> Presumably there's a call to mail() as well ;-)
>>
>> How much access to mailserver logs on both sides do you have? First place
>> I'd
>> look is /var/log/maillog (or equivalent) at least on the sending system
>> to make
>> sure it's going out, and then on the receiving end to see if it arrived
>> but was
>> subsequently zapped by spam filters.
>>
>> --
>> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
>> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool[/color]
>
>[/color]


Closed Thread