Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[PHP/Sendmail] Can't send mails throug php mail()

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
LeisureSuitLarry
Posts: 1
Joined: 2005-08-25 14:42

[PHP/Sendmail] Can't send mails throug php mail()

#1 Post by LeisureSuitLarry »

I've installed Debian Sarge stable and made no major configure changes to the system. I've installed Sendmail and PHP4. When i try to send an e-mail with a php-script:

Code: Select all

<?
$mail_addy="mail@adres";
$headers = "To: $mail_addy\r\n";
$subject = "Test bericht";
$msg = "Dit is een test bericht\nFoo foo\nbar quux!";

$ret = mail($mail_addy,$subject,$msg,$headers);

if($ret) {
    echo "Mail is verstuurd!";
} else {
    echo "Mail is NIET verstuurd!";
}
?>
It won't work. In my mail.log there's only one line in it. The main thing that catches my eye is that 'nrcpts=0'. That seems strange to me.

I can send mail through the command-line and also when i use the PEAR mailclasses and send directly with Sendmail the messages are sent and in mail.log it says 'nrcpts=1'.

What can be the problem that i can't send mail through the normal php-way?

Post Reply