مشکل با header درارسال mail

overcrash

Active Member
نمیدونم چرا وقتی کد اول رو اجرا میکنم میل ارسال میشه ولی با کد دومی ارسال نمیشه؟!
هیچ پیغام خطاییی هم نمیده!
کداول:
PHP:
<?php
$from="[email protected]";
$to  = "[email protected]";
$headers = "From: Once Forever <[email protected]>\r\n";
$headers .= "To: haMid <[email protected]>\r\n";
mail($to,'Subject Goes Here','Body of the email message',$headers);
?>

کددوم
PHP:
<?php
$from="[email protected]";
$to  = "[email protected]";
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$headers .= "From: Once Forever <[email protected]>\r\n";
$headers .= "To: haMid <[email protected]>\r\n";
mail($to,'Subject Goes Here','Body of the email message',$headers);
?>

مشکل کجاست؟!
 

zamanphp

Member
ارسال email

سلام
با كد زير كاملا اجرا مي شه:
PHP:
<?php
$mail_to = $HTTP_POST_VARS['to'];
$mail_subject = $HTTP_POST_VARS['subject'];
$mail_body = $HTTP_POST_VARS['message'];
$mail_from = "[email protected]";
$mail_headers = "From: $mail_from\n";
if(mail($mail_to, $mail_subject, $mail_body, $mail_headers))
   echo("Successfully sent an email titled '$mail_subject'!");
else 
  echo("An error occurred while attempting to send an email titled '$mail_subject'!");
?>
راستي فرم اونو خودت زحمتشو بكش
 

zamanphp

Member
ارسال email

سلام
PHP:
mail('[email protected], [email protected], [email protected]', 
    'Subject', 'Your message here.', 
    "To: The Receiver <[email protected]>\n" . 
    "From: The Sender <[email protected]>\n" . 
    "cc: Interested <[email protected]>\n" . 
    "Bcc: Me Too <[email protected]>\n" . 
    "X-Mailer: PHP 4.x");
مشكل بخاطر
PHP:
 $headers .=
هستش كه آخراشونو ; گذاشتي با كد بالا تستش كد 100 درصد جواب مي ده چون خودم تست كردم
 

جدیدترین ارسال ها

بالا