所以我在this page上有一个普通但很长的HTML表单
该表格的PHP邮件脚本为:-
$to = "something@gmail.com";
$from = $_POST['contact_email'];
$subject = "Application form submission";
$message = "<h2>Tell us what you need?</h2>";
$message .= "Loan Amount Required ?";
$message .= "<br>";
$message .= $_POST['tell_loan_amount'];
$message .= "<br>";
$message .= "<br>";
$message .= "What For?";
$message .= "<br>";
$message .= $_POST['tell_what_for'];
/* and so on */
$headers = "From: $from" . "\r\n" ;
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset: utf8\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
if( mail($to,$subject,$message,$headers)) {
echo "<h1>Thank you for the Application</h1>";
echo "<p>We will now review the application. This process normally takes 2-3 Business Hours. If we need to discuss any aspect of the application we will contact you. If you have any questions at all please do not hesitate to contact us on <strong>1300 815 462</strong></p>";
}
else {
echo "failed";
}
现在的问题是,有时只发送邮件。我已经与多个客户联系,并说他们成功地到达了“谢谢”页面并收到了成功消息,但我们从未收到该邮件。是的,也不在垃圾邮件中。
是否因为将其设置为gmail而发生了?
还是由于编码错误而发生? (我们的客户使用英语填写表格。)
还是我需要使用mb_send_mail()
而不是mail()
并完全删除编码代码?
答案 0 :(得分:0)
在您的服务器上使用此命令,它将输出您的sent mail
发生的情况:
tail -f /var/log/maillog
有时提供商会阻止端口25