Mail not working | |
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 | | | | 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? | | | | 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:
<?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:
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 ... | | | | 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:
<?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:
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. | | | | 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:
<?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:
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? | | | | 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 | | | | 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. | | | | 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. | | | | 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:
<?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:
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. | | | | 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:
<?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:
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 ... |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,295 network members.
|