0

お問い合わせしたり、質問やコメントを残したり、電子メールで送信したりできるウェブサイトがあります。コードは完全に実行されますが、電子メールは送信されません。ここに私のコードがあります:

$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";
}

私の他の作品はメールを送信するのに問題ありませんでしたが、他のサーバーにあります...

4

1 に答える 1