Connecting Tech Pros Worldwide Help | Site Map

Mail not working

nobrow@gmail.com
Guest
 
Posts: n/a
#1: Jun 14 '07
I cannot get php to send an email. This works:

$ mail -s "My Subject" nobrow@gmail.com
My Message
^D
Cc:
[enter]

But this doesnt:

<?php
mail('nobrow@gmail.com', 'My Subject', 'My Message')
or
die('shit!');
?>

I don't know where to look for error messages so I have no further
info. Anyone got a clue?

P.S.

Im using ssmtp, and php.ini contains:

sendmail_path =ssmtp

ZeldorBlat
Guest
 
Posts: n/a
#2: Jun 14 '07

re: Mail not working


On Jun 14, 12:22 pm, nob...@gmail.com wrote:
Quote:
I cannot get php to send an email. This works:
>
$ mail -s "My Subject" nob...@gmail.com
My Message
^D
Cc:
[enter]
>
But this doesnt:
>
<?php
mail('nob...@gmail.com', 'My Subject', 'My Message')
or
die('shit!');
?>
>
I don't know where to look for error messages so I have no further
info. Anyone got a clue?
>
P.S.
>
Im using ssmtp, and php.ini contains:
>
sendmail_path =ssmtp
What do you mean by "doesn't work?" As in you never get the mail? As
in the script dies with "shit?" As in you get an error message?

nobrow@gmail.com
Guest
 
Posts: n/a
#3: Jun 14 '07

re: Mail not working


On Jun 14, 5:55 pm, ZeldorBlat <zeldorb...@gmail.comwrote:
Quote:
On Jun 14, 12:22 pm, nob...@gmail.com wrote:
>
>
>
Quote:
I cannot get php to send an email. This works:
>
Quote:
$ mail -s "My Subject" nob...@gmail.com
My Message
^D
Cc:
[enter]
>
Quote:
But this doesnt:
>
Quote:
<?php
mail('nob...@gmail.com', 'My Subject', 'My Message')
or
die('shit!');
?>
>
Quote:
I don't know where to look for error messages so I have no further
info. Anyone got a clue?
>
Quote:
P.S.
>
Quote:
Im using ssmtp, and php.ini contains:
>
Quote:
sendmail_path =ssmtp
>
What do you mean by "doesn't work?" As in you never get the mail? As
in the script dies with "shit?" As in you get an error message?
No email, mail function returns false, and the die clause kicks in ...

ZeldorBlat
Guest
 
Posts: n/a
#4: Jun 14 '07

re: Mail not working


On Jun 14, 1:22 pm, nob...@gmail.com wrote:
Quote:
On Jun 14, 5:55 pm, ZeldorBlat <zeldorb...@gmail.comwrote:
>
>
>
Quote:
On Jun 14, 12:22 pm, nob...@gmail.com wrote:
>
Quote:
Quote:
I cannot get php to send an email. This works:
>
Quote:
Quote:
$ mail -s "My Subject" nob...@gmail.com
My Message
^D
Cc:
[enter]
>
Quote:
Quote:
But this doesnt:
>
Quote:
Quote:
<?php
mail('nob...@gmail.com', 'My Subject', 'My Message')
or
die('shit!');
?>
>
Quote:
Quote:
I don't know where to look for error messages so I have no further
info. Anyone got a clue?
>
Quote:
Quote:
P.S.
>
Quote:
Quote:
Im using ssmtp, and php.ini contains:
>
Quote:
Quote:
sendmail_path =ssmtp
>
Quote:
What do you mean by "doesn't work?" As in you never get the mail? As
in the script dies with "shit?" As in you get an error message?
>
No email, mail function returns false, and the die clause kicks in ...
Turn up error_reporting and enable display_errors in php.ini. That
will give you any error messages that might be there.

nobrow@gmail.com
Guest
 
Posts: n/a
#5: Jun 14 '07

re: Mail not working



ZeldorBlat wrote:
Quote:
On Jun 14, 1:22 pm, nob...@gmail.com wrote:
Quote:
On Jun 14, 5:55 pm, ZeldorBlat <zeldorb...@gmail.comwrote:


Quote:
On Jun 14, 12:22 pm, nob...@gmail.com wrote:
Quote:
I cannot get php to send an email. This works:
Quote:
$ mail -s "My Subject" nob...@gmail.com
My Message
^D
Cc:
[enter]
Quote:
But this doesnt:
Quote:
<?php
mail('nob...@gmail.com', 'My Subject', 'My Message')
or
die('shit!');
?>
Quote:
I don't know where to look for error messages so I have no further
info. Anyone got a clue?
Quote:
P.S.
Quote:
Im using ssmtp, and php.ini contains:
Quote:
sendmail_path =ssmtp
Quote:
What do you mean by "doesn't work?" As in you never get the mail? As
in the script dies with "shit?" As in you get an error message?
No email, mail function returns false, and the die clause kicks in ...
>
Turn up error_reporting and enable display_errors in php.ini. That
will give you any error messages that might be there.
Sounded like a good idea but the default values were:

error_reporting = E_ALL & ~E_NOTICE
display_errors = On

so I reckon if there are error messages theyd be displayed ... which
isnt happening.

Is there a php error/message log?

Michael Fesser
Guest
 
Posts: n/a
#6: Jun 14 '07

re: Mail not working


..oO(nobrow@gmail.com)
Quote:
>Sounded like a good idea but the default values were:
>
>error_reporting = E_ALL & ~E_NOTICE
On a development machine it should _always_ be

error_reporting = E_ALL

or even

error_reporting = E_ALL | E_STRICT

Just as a side note, I can't help with your current problem.

Micha
nobrow@gmail.com
Guest
 
Posts: n/a
#7: Jun 15 '07

re: Mail not working


On Jun 14, 5:22 pm, nob...@gmail.com wrote:
Quote:
I cannot get php to send an email. This works:
>
$ mail -s "My Subject" nob...@gmail.com
My Message
^D
Cc:
[enter]
>
But this doesnt:
>
<?php
mail('nob...@gmail.com', 'My Subject', 'My Message')
or
die('shit!');
?>
>
I don't know where to look for error messages so I have no further
info. Anyone got a clue?
>
P.S.
>
Im using ssmtp, and php.ini contains:
>
sendmail_path =ssmtp
It works from the interactive php shell, so the conclusion is that
this is actually an apache problem, perhaps related to running in a
chroot.

bill
Guest
 
Posts: n/a
#8: Jun 15 '07

re: Mail not working


nobrow@gmail.com wrote:
Quote:
On Jun 14, 5:22 pm, nob...@gmail.com wrote:
Quote:
>I cannot get php to send an email. This works:
>>
>$ mail -s "My Subject" nob...@gmail.com
>My Message
>^D
>Cc:
>[enter]
>>
>But this doesnt:
>>
><?php
> mail('nob...@gmail.com', 'My Subject', 'My Message')
> or
> die('shit!');
>?>
>>
>I don't know where to look for error messages so I have no further
>info. Anyone got a clue?
>>
>P.S.
>>
>Im using ssmtp, and php.ini contains:
>>
>sendmail_path =ssmtp
>
It works from the interactive php shell, so the conclusion is that
this is actually an apache problem, perhaps related to running in a
chroot.
>
working from the command line is invoking the shell's mail, not
PHP's mail.
nobrow@gmail.com
Guest
 
Posts: n/a
#9: Jun 15 '07

re: Mail not working


On Jun 15, 7:27 pm, bill <nob...@spamcop.netwrote:
Quote:
nob...@gmail.com wrote:
Quote:
On Jun 14, 5:22 pm, nob...@gmail.com wrote:
Quote:
I cannot get php to send an email. This works:
>
Quote:
Quote:
$ mail -s "My Subject" nob...@gmail.com
My Message
^D
Cc:
[enter]
>
Quote:
Quote:
But this doesnt:
>
Quote:
Quote:
<?php
mail('nob...@gmail.com', 'My Subject', 'My Message')
or
die('shit!');
?>
>
Quote:
Quote:
I don't know where to look for error messages so I have no further
info. Anyone got a clue?
>
Quote:
Quote:
P.S.
>
Quote:
Quote:
Im using ssmtp, and php.ini contains:
>
Quote:
Quote:
sendmail_path =ssmtp
>
Quote:
It works from the interactive php shell, so the conclusion is that
this is actually an apache problem, perhaps related to running in a
chroot.
>
working from the command line is invoking the shell's mail, not
PHP's mail.
The problem was that there was no mail program in the chroot I run
Apache in. Installed one and got it working and alls fine now. Silly
oversight really.

nobrow@gmail.com
Guest
 
Posts: n/a
#10: Jun 15 '07

re: Mail not working


On Jun 15, 7:27 pm, bill <nob...@spamcop.netwrote:
Quote:
nob...@gmail.com wrote:
Quote:
On Jun 14, 5:22 pm, nob...@gmail.com wrote:
Quote:
I cannot get php to send an email. This works:
>
Quote:
Quote:
$ mail -s "My Subject" nob...@gmail.com
My Message
^D
Cc:
[enter]
>
Quote:
Quote:
But this doesnt:
>
Quote:
Quote:
<?php
mail('nob...@gmail.com', 'My Subject', 'My Message')
or
die('shit!');
?>
>
Quote:
Quote:
I don't know where to look for error messages so I have no further
info. Anyone got a clue?
>
Quote:
Quote:
P.S.
>
Quote:
Quote:
Im using ssmtp, and php.ini contains:
>
Quote:
Quote:
sendmail_path =ssmtp
>
Quote:
It works from the interactive php shell, so the conclusion is that
this is actually an apache problem, perhaps related to running in a
chroot.
>
working from the command line is invoking the shell's mail, not
PHP's mail.
BTW, I was talking about it working in "the interactive php shell" ...
$ php -a ...

Closed Thread