メールで質問できるウェブサイトを開発しています。送信するたびに、常にスパムになります。ここに私のコードがあります:
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$phone = $_POST['phone'];
$city = $_POST['city'];
$QuestionComment = $_POST['comments'];
$hear = $_POST['about_us'];
$email_address = $_POST['email'];
// the first email is for thank you! email
date_default_timezone_set('Asia/Manila');
$mail = new PHPMailer();
$body = "Hi,<br /> <br />Thank you for contacting Magosaburo Philippines. <br />Please await for a confirmation email regarding your reservations and other concerns.";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.magosaburo.com.ph"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "mail.magosaburo.com.ph"; // sets the SMTP server
$mail->Port = 25; // set the SMTP port for the GMAIL server
$mail->Username = "//dont mind it"; // SMTP account username
$mail->Password = "//dont mind it"; // SMTP account password
$address = $email_address;
$mail->AddAddress($address);
$mail->Subject = "Thank you from Magosaburo";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->SetFrom('send_mail@magosaburo.com.ph', 'Magosaburo');
$mail->AddReplyTo("send_mail@magosaburo.com.ph",'Magosaburo');
$mail->MsgHTML($body);
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message sent!";
}
私はPHPの電子メール送信が初めてで、スパムになる方法や理由がわかりません。ありがとう!