Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4891 > unrolled thread

Mail() function not working in PHP5

Started byAnuj Agarwal <coolbuddyguy@gmail.com>
First post2012-02-18 09:20 -0800
Last post2012-02-18 22:54 +0100
Articles 5 — 5 participants

Back to article view | Back to comp.lang.php


Contents

  Mail() function not working in PHP5 Anuj Agarwal <coolbuddyguy@gmail.com> - 2012-02-18 09:20 -0800
    Re: Mail() function not working in PHP5 The Natural Philosopher <tnp@invalid.invalid> - 2012-02-18 17:42 +0000
    Re: Mail() function not working in PHP5 Michael Vilain <vilain@NOspamcop.net> - 2012-02-18 11:40 -0800
    Re: Mail() function not working in PHP5 Jerry Stuckle <jstucklex@attglobal.net> - 2012-02-18 15:38 -0500
    Re: Mail() function not working in PHP5 "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-02-18 22:54 +0100

#4891 — Mail() function not working in PHP5

FromAnuj Agarwal <coolbuddyguy@gmail.com>
Date2012-02-18 09:20 -0800
SubjectMail() function not working in PHP5
Message-ID<b3c96175-1fdd-47f9-88e2-8b3628d7fb80@tc8g2000pbc.googlegroups.com>
Hi,

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?

Thanks,
Anuj

[toc] | [next] | [standalone]


#4892

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-18 17:42 +0000
Message-ID<jhonth$o4k$2@news.albasani.net>
In reply to#4891
Anuj Agarwal wrote:
> Hi,
> 
> 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?
> 
> Thanks,
> Anuj


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?

[toc] | [prev] | [next] | [standalone]


#4895

FromMichael Vilain <vilain@NOspamcop.net>
Date2012-02-18 11:40 -0800
Message-ID<vilain-57AE29.11403918022012@news.individual.net>
In reply to#4891
In article 
<b3c96175-1fdd-47f9-88e2-8b3628d7fb80@tc8g2000pbc.googlegroups.com>,
 Anuj Agarwal <coolbuddyguy@gmail.com> wrote:

> Hi,
> 
> 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?
> 
> Thanks,
> Anuj

"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 
research).

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

[toc] | [prev] | [next] | [standalone]


#4896

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-02-18 15:38 -0500
Message-ID<jhp27m$g54$1@dont-email.me>
In reply to#4891
On 2/18/2012 12:20 PM, Anuj Agarwal wrote:
> Hi,
>
> 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?
>
> Thanks,
> Anuj

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.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#4897

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-02-18 22:54 +0100
Message-ID<9qal15Fnl0U1@mid.uni-berlin.de>
In reply to#4891
Am 18.02.2012 18:20, schrieb Anuj Agarwal:
> Hi,
> 
> 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?
> 
> Thanks,
> Anuj

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/mail.info. Something there?

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

/Str.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web