We are using sendmail on linux 8/PHP 4. We are unable to send the mail, however we dont get any error in mail function. In fact we dont know where mail is delivering.

Same application is working properly in Lunix 7/PHP 3.

We are stuck here, please let us know whats wrong we are doing?

We are using following coding:

<?php
$mail_to="ashishkanoongo@rediffmail.com";
$mail_from="ramsharma_indr@rediffmail.com";
$mail_reply_to="ramsharma_indr@rediffmail.com";
$mail_cc="ramsharma_indr@rediffmail.com";
$mail_bcc="ramsharma_indr@hotmail.com";
$mail_headers = "From: $mail_from\r\nReply-to:
$mail_reply_to\r\nCc:$mail_cc\r\nBcc: $mail_bcc";
$mail_subject = "test";
$mail_body = "test";
if(mail($mail_to,$mail_subject,$mail_body,$mail_headers)){
echo "sucess";
}
else
{
echo "error";
}
?>


    I have the same problem with php4.2.3 on a mandrake 7.2 machine. The script however sends email fine from a redhat 7.2 box running php4.1.2.

    any ideas before I upgrade to 4.3??

      There's no such thing as "Linux 8." What distribution are you actually using?

      What mail transfer agent? Is it installed and working correctly? This is not likely to be a PHP issue. PHP on Linux hands the data to sendmail.

        I am using mandrake 7.2 php version 4.2.3, and exim3.20.

        Exim is working correctly, but for some reason php's mail function is returning false. Here is a snippet of my code:
        ?>
        if (@mail($to, $subject, $content, $from))
        {
        echo ("mail sent");
        }
        else{
        echo ("mail not sent");
        }
        ?>

        Any help you can provide is greatly appreciated.

        Thanks!

          Eric, it is likely that the sendmail-compatibility wrapper used by exim is complaining about something. Check your system logs.

            Thanks,

            But after looking through a few exim message boards, I've deciced to remove exim from the server completely. Now I have sendmail installed, and still have the same problem.

            Php's mail function is returning false. any ideas?

              We have found the solution.

              We have recreate/rebuild sendmail.cf from sendmail.mc and copy to /etc folder and rstart sendmail.

                I tried rebuilding sendmail.cf from sendmail.mc and still the mail function returns false.

                Any other Ideas?

                Thanks

                  Write a Reply...