473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Why PHP Mail Not Sent

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 = 'g*****@herwebsite.com';
$subject = 'Wakeup Gladys!';
$message = '<b>yo</b>, whassup?';
$headers = "From: vi*@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
Jan 13 '06 #1
12 2349
On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vi*@showsec.com> wrote:
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 = 'g*****@herwebsite.com';
$subject = 'Wakeup Gladys!';
$message = '<b>yo</b>, whassup?';
$headers = "From: vi*@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";


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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 13 '06 #2
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" <an**@andyh.co.uk> wrote in message
news:o5********************************@4ax.com...
On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vi*@showsec.com>
wrote:
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 = 'g*****@herwebsite.com';
$subject = 'Wakeup Gladys!';
$message = '<b>yo</b>, whassup?';
$headers = "From: vi*@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";


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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

Jan 14 '06 #3
On Fri, 13 Jan 2006 15:45:51 -0800, "Vic Spainhower" <vi*@showsec.com> wrote:
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?


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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 14 '06 #4
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" <an**@andyh.co.uk> wrote in message
news:o5********************************@4ax.com...
On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vi*@showsec.com>
wrote:
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 = 'g*****@herwebsite.com';
$subject = 'Wakeup Gladys!';
$message = '<b>yo</b>, whassup?';
$headers = "From: vi*@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";


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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

Jan 15 '06 #5
Vic Spainhower wrote:
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 = 'g*****@herwebsite.com';
$subject = 'Wakeup Gladys!';
$message = '<b>yo</b>, whassup?';
$headers = "From: vi*@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";


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

Jan 15 '06 #6
Phil,

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

Vic
"Philip Ronan" <no****@example.invalid> wrote in message
news:00*****************************@news.blueyond er.co.uk...
Vic Spainhower wrote:
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 = 'g*****@herwebsite.com';
$subject = 'Wakeup Gladys!';
$message = '<b>yo</b>, whassup?';
$headers = "From: vi*@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";


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

Jan 15 '06 #7
Vic Spainhower wrote:
Phil,

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

Vic


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

Jan 15 '06 #8
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: <WE*************************@web78.expresstech.net >
X-OriginalArrivalTime: 16 Jan 2006 14:35:21.0359 (UTC)
FILETIME=[1446E1F0:01C61AAA]

Appreciate your help in this ...

Vic

Jan 16 '06 #9
>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.
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.

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: <WE*************************@web78.expresstech.net >
X-OriginalArrivalTime: 16 Jan 2006 14:35:21.0359 (UTC)
FILETIME=[1446E1F0:01C61AAA]

Appreciate your help in this ...

Vic


Gordon L. Burditt
Jan 16 '06 #10
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" <jm******@yahoo.com> wrote in message
news:pK******************************@comcast.com. ..
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" <an**@andyh.co.uk> wrote in message
news:o5********************************@4ax.com...
On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vi*@showsec.com>
wrote:
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 = 'g*****@herwebsite.com';
$subject = 'Wakeup Gladys!';
$message = '<b>yo</b>, whassup?';
$headers = "From: vi*@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";


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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


Jan 16 '06 #11
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" <go***********@burditt.org> wrote in message news:11*************@corp.supernews.com...
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.


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.

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: <WE*************************@web78.expresstech.net >
X-OriginalArrivalTime: 16 Jan 2006 14:35:21.0359 (UTC)
FILETIME=[1446E1F0:01C61AAA]

Appreciate your help in this ...

Vic


Gordon L. Burditt

Jan 16 '06 #12
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" <jm******@yahoo.com> wrote in message
news:pK******************************@comcast.com. ..
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" <an**@andyh.co.uk> wrote in message
news:o5********************************@4ax.com...
On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vi*@showsec.com>
wrote:
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 = 'g*****@herwebsite.com';
$subject = 'Wakeup Gladys!';
$message = '<b>yo</b>, whassup?';
$headers = "From: vi*@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";


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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


Jan 24 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lu | last post by:
Hi, I have a redhat 9 linux machine running apache 2.0.47, mysql 4.0.15, and php 4.3.4. I have been puzzled by this mail() problem for quite a while, could someone please give me some hint on...
4
by: Giobibo | last post by:
I use the following code to send e-mails with PHP: if(@mail(....)) { //Send OK } else { //Send Bad } But how can I verify that a message was really sent (in case of "Sent
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
17
by: LACH | last post by:
When I sent e-mail from within my asp.net application to Hotmail adresses. The e-mail always end up in Junk e-mail. I sent the e-mail as plain/text. Does anyone know how to solve this?
6
by: Geoff Berrow | last post by:
I'm doing a bit of work for a guy and on his system the mail() function always returns false, but the mail is sent. Anyone come across this? Any ideas what is causing it and how to fix it? --...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
1
by: William Connery | last post by:
Hi, I have a small python program with e-mail capabilities that I have pieced together from code snippets found on the internet. The program uses the smtplib module to successfully send an...
2
by: prasenjit2007 | last post by:
Hello, can u help me sending Email with attachments using the Class phpMailer. On the website I have a link to an html form in which I input the parameters with the names 1)from(textbox name)...
9
by: Keith G Hicks | last post by:
I have a vb app that runs on a server. It periodically checks for rows in a table that are ready to have data mailed out to clients. After it finds row(s) that are ready, it emails the info out and...
6
by: simon2x1 | last post by:
the code below is my mail code its working but message sent to the email is going to the spam mail not the inbox how can make the message go to indox <?php require_once("connect.php"); //...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.