Hi, I am working on Linux Debian (Exim 3.36 mail server). when i tried using mail command in command line argument, its working and when i am using php mail to send mail its not working. Do i need to explicitly give sendmail_path. I got no errors. please help. Thanks.
I got error which says Message delivery failed...Can't send email i used the command <?php $to = "[email protected]"; $from = "[email protected]"; $subject = "Hi test"; $body = "Testing Email"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\n"; $headers .= "From:$from"; mail($to, $subject, $body, $headers); if (mail($to, $subject, $body, $headers)) { echo("<p>Message successfully (root)sent!to $to</p>"); } else { echo("<p>Message delivery failed...Can't send email to $to</p>"); } ?> please help me finding the error. Thanks
In my mail log , i got /var/log/exim/mainlog 2006-11-17 09:38:01 Start queue run: pid=4326 2006-11-17 09:38:01 End queue run: pid=4326 please help.why i am receiving the error message? I could not able to receive mail in my mailbox? i used phpinfo() in my program it gives sendmail_from no values sendmail_path /usr/sbin/sendmail smtp localhost smtp_port 25 Thanks in advance.
you should use the phpmailer class. it makes working with emails in your script a breeze. http://phpmailer.sourceforge.net/