Mail() function not working in PHP5

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am working on Ubuntu 10.04 and trying to send the email using my
website page. I have setup send mail to send emails. Also, i have
tested that i can send an email from command line using mail command
to my email id. But when i do it using php web page, it does not work.

Can anybody solve this problem?


Re: Mail() function not working in PHP5

Anuj Agarwal wrote:
Quoted text here. Click to load it

What is the actual line in your PHP that sends an email?

Is the server totally under your control?

What OS is the PHP running on?

How did you successfully send an email in the first place?

Re: Mail() function not working in PHP5

In article

Quoted text here. Click to load it

"mail does not work" could mean a number of things.  php's mail() is a
mail _client_ that submits a message to the local system's MTA.  If the
MTA isn't running or not setup properly, the mail sits in the queue
undelivered unless it's local (e.g. mail() sends to root on the local
machine).  The various log files will tell you just how far mail() is
working.  My guess is that it is, but not somewhere the mail system
either mis-configured or not doing it's thing.

If you don't know or understand how mail works, chances are it's
somewhere outside of mail() control.  Once it stuffs a message into the
mail system's queue, it's done.  What happens after that is up to you to
figure out.  Look at the log files (which ones are left to you to

DeeDee, don't press that button!  DeeDee!  NO!  Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]

Re: Mail() function not working in PHP5

On 2/18/2012 12:20 PM, Anuj Agarwal wrote:
Quoted text here. Click to load it

A lot of possibilities here.  The first question is - is your mail not
being sent, or is it not being delivered?  Both are equally possible.
You need to determine which it is.

Your best bet to start out is your sendmail log and see which it is.
For instance, your MTA may require a login to send mail.  It might
reject the mail due to incorrect headers.  Alternatively, it could
easily be sending the mail but your receiving MTA is rejecting it for
some reason.

So you need to do more digging to see which it is.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Mail() function not working in PHP5

Am 18.02.2012 18:20, schrieb Anuj Agarwal:
Quoted text here. Click to load it

Adjust your settings so you get error messages from php, then see if you can find
error messages in /var/log/apache2/error.log

Then look at /var/log/ Something there?

Make sure mail that bounces back gets directed to a mailbox where you can find


Site Timeline