在新服务器上,我注意到邮件的发送时间要晚得多。它不会一直发生,但足以让它困扰我并想要找出问题。
请不要告诉我使用邮件程序或其他内容。我已经使用php的mail()来处理像今年这样简单的东西,直到现在才出现问题所以它必须是这个服务器上的设置或奇怪的东西。
我收到他们刚刚延迟发送的电子邮件,它会随机出现。
电子邮件的示例跟踪(注意发送和退出时间):
Event: success success
User: user
Domain: sending.com
Sender: user@server.example.com
Sent Time: Feb 2, 2015 3:47:15 PM
Sender Host: localhost
Sender IP: 127.0.0.1
Authentication: localuser
Spam Score:
Recipient: support@receiver.com
Delivery User: -remote-
Delivery Domain:
Delivered To: support@receiver.com
Router: lookuphost
Transport: remote_smtp
Out Time: Feb 3, 2015 2:04:02 AM
ID: 1YINtp-00067R-8i
Delivery Host: receiver.com
Delivery IP: 111.111.111.111
Size: 836 bytes
Result: Message accepted
这是我编写并用于发送邮件的简单函数:
// Send Mail
function send_mail($to,$from,$subject,$message)
{
// Create the email
$headers = '';
$headers .= "From: ".$from."\r\n";
$headers .= "Reply-to: ".$from."\r\n";
$headers .= "Return-Path: ".$from."\r\n";
$headers .= "Message-ID: <" . md5(uniqid(time())) . "@" . $_SERVER['SERVER_NAME'] . ">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Date: " . date('r', time()) . "\r\n";
mail($to,$subject,$message,$headers);
}