Hi;
I have Unix server and i have tried the following code to send an email:
==>
ini_set('error_reporting', E_ALL);
ini_set ("SMTP","193.188.87.163");
ini_set ("sendmail_path", "/usr/sbin/sendmail -t -i");
$Msg= "
Name | " .
$_REQUEST['Yname'] .
" |
Email | " .
$_REQUEST['Email'] .
" |
The message is | " .
$_REQUEST['body'] . " |
";
$FMail = $_$_REQUEST ['Email'] ;
$TMail = "alaa@cmc-amman.gov.jo" ;
$MSub = "CMC-Web Mail" ;
$fromname= $_REQUEST['Yname'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $fromname <$FMail>" ;
if (mail ($TMail ,$MSub, $Msg,$headers))
echo "Your mail have been sent";
else
echo "Sorry, your mail cant be sent";
?>
==>
the code is successful on localhost but failed when i uploaded it to the server ==> why?
2007-03-18
00:11:05
·
4 answers
·
asked by
alaa_alomari
1
in
Programming & Design