ตอนทำเสร็จไปใหม่ๆก็นานแล้วนะครับยังส่งเมล์ได้อยู่ วันนี้มีแจ้งมาว่ามีเมล์เดิมๆส่งมาถี่ๆ ยังไม่ได้ดูว่าเมล์ที่ส่งมาเป็นเมล์ที่ส่งมาจากใหน ไม่รู้ว่าใช่ที่ส่งมาจากในเว็บหรือเปล่า เพราะ ไปยุ่งเมล์ไม่ได้เจ้าของไม่ให้ดูครับ เลยไม่รู้ว่าเป็นที่codeหรือ mail server แต่ตอนนี้เมล์ในหน้าเว็บมันส่งไม่ได้อยู่เลยคิดว่าจะเป็นที่ mail server หรือเปล่า หรือโดน spam mail code ตามข้างล่างเลยครับ หรือที่เว็บนี้ครับ
http://hydroperse.com/contact.php ช่วยทีครับ
<div class="col-sm-6">
<form role="form" id="footer-form" class=" wow fadeInUp"data-wow-delay="0.4s" action="contact.php" method="post">
<div class="form-group has-feedback">
<label class="sr-only" for="name2">Name</label>
<input type="text" class="form-control" id="name2" placeholder="Name" name="txt_name" required>
<i class="fa fa-user form-control-feedback"></i>
</div>
<div class="form-group has-feedback">
<label class="sr-only" for="email2">Subject</label>
<input class="form-control" id="email2" placeholder="Subject" name="txt_subject" required>
<i class="fa fa-pencil form-control-feedback"></i>
</div>
<div class="form-group has-feedback">
<label class="sr-only" for="email2">Email address</label>
<input type="email" class="form-control" id="email2" placeholder="Enter email" name="txt_email" required>
<i class="fa fa-envelope form-control-feedback"></i>
</div>
<div class="form-group has-feedback">
<label class="sr-only" for="message2">Message</label>
<textarea class="form-control" rows="8" id="message2" placeholder="Message" name="txt_description" required></textarea>
<i class="fa fa-pencil form-control-feedback"></i>
</div>
<div class="footer-content">
<input type="submit" value="Send" class="btn btn-default">
</form>
</div>
</div>
</div>
</div>
</div>
<?
$name =$_POST["txt_name"];
$subject= $_POST["txt_subject"];
$email= $_POST["txt_email"];
$description= $_POST["txt_description"];
?>
<?php
include('PHPMailer/class.phpmailer.php');
include("PHPMailer/class.smtp.php");
$mail = new PHPMailer();
$mail->CharSet="utf-8";
$mail->IsSMTP();
$mail->SMTPSecure = "smtp";
$mail->Host = 'smtp.gmail.com';
$mail->Port = 25;
$mail->SMTPAuth = true;
$mail->Username = 'info@hydroperse.com';
$mail->Password = 'pass';
$mail->SetFrom($email);
$mail->FromName = $name;
$mail->Subject = $subject;
$mail->Body ="Name :" .$name." <hr> <br> Subject :" .$subject. " <hr> <br> Email : " .$email." <hr> <br> Detail : " .$description;
$mail->AltBody ="Name : " .$name." <hr> <br> Subject : " .$subject. " <hr> <br> Email : " .$email." <hr> <br> Detail : " .$description;
$mail->Username = 'info@hydroperse.com';
if(empty($_POST["txt_name"]) && empty($_POST["txt_subject"]) && empty($_POST["txt_email"]) && empty($_POST["txt_description"]))
{
echo "";
}
else {
if (!$mail->Send()) {
//echo "Mailer Error: " . $mail->ErrorInfo;
echo "<script> alert('Not SEND E-mail '); window.location = 'contact.php'; </script>";
} else {
echo "<script> alert(' SEND E-mail '); window.location = 'contact.php'; </script>";
}
}
?>