Hi;
I have BSD Unix server and i have tried the code below using the localhost on my pc (winxp OS) and it is was successful but when i tried it using the unix server, it takes long time and at last did not send the mail (output the else part of the if st.==>Sorry... mail was not sent).
also i tried to remove all ini_set, but in this case the mail was not sent neither on localhost nor on the unix server.
==> the code is:
ini_set("sendmail_from", "sample@example.com");
ini_set("SMTP", "193.188.87.163");
ini_set ("sendmail_path","sendmail -t -i -F sample@example.com -f sample@example.com");
//I tried this instead of the line above ini_set ("sendmail_path", "/usr/sbin/sendmail -t -i");
ini_set("error_reporting", E_ALL);
$emailaddress="alaa@cmc-amman.gov.jo";
$emailsubject="TEST";
$msg="TEST Mail!";
$result = mail($emailaddress, $emailsubject, $msg);
ini_restore("sendmail_from");
if ($result)
Echo "Mail sent";
else
Echo "Sorry... mail was not sent";
?>
2007-03-19
23:25:29
·
4 answers
·
asked by
alaa_alomari
1
in
Computers & Internet
➔ Programming & Design