Forum Moderators: coopster

Message Too Old, No Replies

mail() function no longer working

Unchanged code now no longer works

         

iceman22

2:03 pm on Mar 31, 2005 (gmt 0)

10+ Year Member



I was recently writing a script that utlises the mail() function, I could not figure out why it wasn't working, I tried different recipients as well. It seems that the mail() function is broken, as a few other scripts that were unchanged also no longer work.

What are the possible reasons for mail() to stop working? In the past it has been due to the mailbox being full, but it is empty at the moment.

The only thing I can think of is my ISP has broken something in PHP or sendmail, I'm out of ideas...

ramoneguru

7:50 am on Apr 1, 2005 (gmt 0)

10+ Year Member



Really? I'm running ver 4.3.2 and it worked fine for this:
mail ($address, $subject, $body, $headers)

Where address, subject, body and headers were already defined. I did have problems sending this to friends who had filters on their email, but never just a failure of the mail function being executed...Sorry, that didn't contribute much.
--Nick

iceman22

4:44 am on Apr 11, 2005 (gmt 0)

10+ Year Member



Sorry to bump this thread but there's something I didn't notice at the time of posting. I have a daily cronjob that emails some stats to myname@mydomain.com. The mail() function in this script remains unaffected.

However in existing scripts that use email addresses such as gmail.com, or even my local ISP emails, the emails are not delivered. The mail function will return a boolean of true, but the mail will not get any further than that. The only solution to this problem was to replace all these emails with myname@mydomain.com, this is not an option though.

I've exhausted all the possible reasons I can think of, my hosting provider has not responded to support emails or a trouble ticket. Can someone offer any solutions?

Thanks

jatar_k

4:47 am on Apr 11, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you would need to check the mail logs to see if they are getting sent, it could just be that they get burned on the receiving end.

iceman22

5:13 am on Apr 11, 2005 (gmt 0)

10+ Year Member



By burned do you mean just deleted by the recipient's server? This is definitely not the case, no email address works other than my domain. No problems have been encountered previously with the emails, the junk mail folders remain empty as well.

The mail logs are only available to root so I am unable to open them.

tomda

5:54 am on Apr 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See also the phpinfo page in your host.
I know for example that one of my host has changed the name of the function - e.g. from mail() to send_mail().
May be they changed it without notice.

iceman22

2:32 pm on Apr 11, 2005 (gmt 0)

10+ Year Member



This is all phpinfo() outputs relating to mail:

PHP Core
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i usr/sbin/sendmail -t -i

standard
Path to sendmail /usr/sbin/sendmail -t -i

It's not a problem with the wrong function, as mail delivers to recipients of my domain, apparently. I also tried send_mail but it's not made a defined function.

jatar_k

4:27 pm on Apr 11, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if they are not getting accepted to sendmail then the function wouldn't be returning true

you need to talk to your host, either your mail server is not relaying or they are disappearing at the other end