我在发送电子邮件时遇到问题后缀+php7。我按下按钮发送电子邮件并收到邮件,但有时点击同一个按钮邮件却没有到达。过了一会儿或几分钟后,我尝试发送电子邮件并且成功了。
这是在服务器端发送电子邮件的 php 代码,我使用的是 ajax。
$message = "<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<style>
.dataClass{
font-size: 14px;
font-weight: bold;
}</style>
</head>
<body>
test email dealer processing
</body>
</html>
";
$headers =
'MIME-Version: 1.0' . "\r\n".
'Content-type: text/html; charset=iso-8859-1' . "\r\n".
'From: ScanChex <[email protected]>' . "\r\n".
'Reply-To: ScanChex <[email protected]>' ."\r\n";
$sent = mail($email, 'Welcome To ScanChex dealer ', $message, $headers);
这是电子邮件发送成功时的响应/var/log/mail.log
****Aug 27 00:28:46 localhost postfix/smtp[9308]: 0C0C9122A00: to=<[email protected]>, relay=gmail-smtp-in.l.google.com
[108.177.98.27]:25, delay=0.27, delays=0/0.01/0.07/0.19, dsn=2.0.0, status=sent (250 2.0.0 OK 1503793726 v37si5208238plg
.629 - gsmtp)****
这是/var/log/mail.log当电子邮件未发送时
**Aug 27 00:31:37 localhost postfix/local[9358]: 6F8BC122A09: to=<[email protected]>, orig_to=<[email protected]>,
relay=local, delay=0.01, delays=0/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Aug 27 00:31:37 localhost postfix/qmgr[27663]: 6F8BC122A09: removed**
我不明白为什么“to”会更改为或者何时是相同的过程。<[email protected]>
<[email protected]>