我有一个网站,您可以在其中查询或留下问题和评论并通过电子邮件发送,代码运行完美,但不发送电子邮件。这是我的代码:
$myemail = 'albertdaracan@gmail.com';//<-----Put Your email address here.
$fname = "albert";
$lname = "daracan";
$subject = "Magosaburo Inquery Form";
$email_address = $_POST['email'];
$message = "Name: ".$fname." ".$lname;
$message = "test";
$to = $myemail;
$email_subject = $subject;
$email_body = $message;
$headers = "From: $fname $lname <$email_address>\n";
$headers .= "Cc: ";
$headers .= "Reply-To: $email_address";
//redirect to the 'thank you' page
if(mail($to,$email_subject,$email_body,$headers)){
echo "mail successful send";
}else{
echo "Could not send you mail, Please try again later";
}
$message2 = "test";
$to2 = $email_address;
$email_subject2 = "Magosaburo";
$email_body2 = "$message2";
$headers2 = "From: Magosaburo <$myemail>\n";
$headers2 .= "Reply-To: $email_address";
//redirect to the 'thank you' page
if(mail($to2,$email_subject2,$email_body2,$headers2)){
echo "mail successful send";
}else{
echo "Could not send you mail, Please try again later";
}
我的其他作品很好,它发送电子邮件,但它在其他服务器中......