Forum Moderators: coopster

Message Too Old, No Replies

php mail problem

problem/bug or something while sending emails

         

omoutop

8:00 am on Oct 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi all.

Recently a strange problem/bug appeared in one of my scripts. A user fills a form and send it to me with email. The email contains all the fields of the user plus some more data from a database. The fields are also stored in a database for cross-reference.

But 1 out of 10 emails fails. I see the record in the databse, but no email reachs me.

I have tested the script with Opera, IE and Firefox, and with 6 emails accounts (yahoo, hotmail, google, plus some company emails).

The script use the php mail() function (no smtp) and I use it in all of my applications, without any problems so far.

What could it be wrong in this case? Any ideas on what to check?

Any help/advise is appreciated!

barns101

11:10 am on Oct 11, 2006 (gmt 0)

10+ Year Member



Maybe a spam filter is blocking some emails based on their content? Maybe your mail server cannot be reached (to send the email) on rare occasions.

omoutop

3:11 pm on Oct 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The content is perfectly legal to my knowledge (name, email, address, some phones, age, country and stuff like that)

As for the server option: is there a way to determine if the server is reachable and if not to switch to some other means?

barns101

6:51 pm on Oct 11, 2006 (gmt 0)

10+ Year Member



You can use code like this:


$mail = mail('you@example.com', 'Subject', 'Message', headers);
if($mail)
{
echo 'Message sent.';
}
else
{
echo 'Message NOT sent!';
}

I don't know exactly what that confirms but it is a better indication than nothing as to whether your message has been accepted by sendmail.

eelixduppy

7:06 pm on Oct 11, 2006 (gmt 0)



>>>I don't know exactly what that confirms


Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.


[us3.php.net...]

omoutop

5:51 am on Oct 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The email is sent ok, it just never reaches my inbox.
And it gets very frustrating.... If this situation was constant, I would have probably figure it out.... but now it seems kind random :(

barns101

12:10 pm on Oct 12, 2006 (gmt 0)

10+ Year Member



Sounds like a spam filter if it is apparently random but affecting 10% of emails.