我有一個應用程序運行在EC2實例上。 在部分應用程序中,需要通過電子郵件向用戶發送通知。我使用PHP的本地mail()函數。郵件收到後期EC2 PHP
問題是,它似乎不是很穩定。我昨天做了一些測試,發現有些電子郵件是立即收到的,但有些似乎等了很長時間。
我在一分鐘內觸發了兩個通知,幾秒鐘後我收到第二個事件的通知,但第一個事件通知出現在我的收件箱中需要半小時。
下面是該回來晚的一個電子郵件標題:
Delivered-To: [email protected]
Received: by 10.140.107.75 with SMTP id g69csp40419qgf; Wed, 3 Dec 2014 16:12:00 -0800 (PST)
X-Received: by 10.194.108.162 with SMTP id hl2mr11475479wjb.102.1417651919645; Wed, 03 Dec 2014 16:11:59 -0800 (PST)
Return-Path: <[email protected]>
Received: from ip-xxx-xxx-xxx-xxx.localdomain (ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com. [xx.xx.xx.xx])
by mx.google.com with ESMTP id g6si19323730wjy.43.2014.12.03.16.11.59
for <[email protected]>; Wed, 03 Dec 2014 16:11:59 -0800 (PST)
Received-SPF: none (google.com: [email protected] does not designate permitted sender hosts) client-ip=xx.xx.xx.xx;
Authentication-Results: mx.google.com; spf=none (google.com: [email protected] does not designate permitted sender hosts) [email protected]; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com
Received: by ip-172-31-19-221.localdomain (Postfix, from userid 48 id CABF521F29; Wed, 3 Dec 2014 23:38:35 +0000 (UTC)
To: ---- <[email protected]>
Subject: Test
X-PHP-Originating-Script: 500:Notifier.class.php
From: ---- <[email protected]>
Message-Id: <[email protected]>
Date: Wed, 3 Dec 2014 23:38:35 +0000 (UTC)
我無法弄清楚是什麼原因造成這一點,所以如果任何人有一個想法,其中的問題可能是,答案是非常感謝!
你意識到,PHP絕對沒有什麼與實際交付? php的工作就是把你的信件放在街角,並把它扔進郵箱。如果郵政服務很慢,那不是php的問題。 – 2014-12-04 17:19:08