FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Mail() function not working in PHP5
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Mail() function not working in PHP5 [message #177074] Sat, 18 February 2012 17:20 Go to next message
Anuj Agarwal is currently offline  Anuj Agarwal
Messages: 1
Registered: February 2012
Karma: 0
Junior Member
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
Re: Mail() function not working in PHP5 [message #177075 is a reply to message #177074] Sat, 18 February 2012 17:42 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
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?
Re: Mail() function not working in PHP5 [message #177078 is a reply to message #177074] Sat, 18 February 2012 19:40 Go to previous messageGo to next message
Michael Vilain is currently offline  Michael Vilain
Messages: 88
Registered: September 2010
Karma: 0
Member
In article
<b3c96175-1fdd-47f9-88e2-8b3628d7fb80(at)tc8g2000pbc(dot)googlegroups(dot)com>,
Anuj Agarwal <coolbuddyguy(at)gmail(dot)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]
Re: Mail() function not working in PHP5 [message #177079 is a reply to message #177074] Sat, 18 February 2012 20:38 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: Mail() function not working in PHP5 [message #177080 is a reply to message #177074] Sat, 18 February 2012 21:54 Go to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Bootstrap for php developers
Next Topic: Do I still CLI version of PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 18 05:31:18 GMT 2024

Total time taken to generate the page: 0.02497 seconds