我正在使用邮件功能如下:
mail($emailto, $subject, $body, $headers);
mail('askme@mysite.com', $subject.' / '.$emailto, $body, $headers);
第一个是为最终用户设计的。第二份是给我的,用于记录保存。
有时最终用户会指定他们的电子邮件地址,有时则为空白。
- 指定电子邮件地址后,最终用户实际上可以毫无问题地收到电子邮件
- 但是,无论哪种情况,都不会向 askme@example.com 发送电子邮件——我也检查了垃圾邮件文件夹。
在我的 /mail/new 文件夹中,我看到许多创建的文件类似于以下内容。该错误不正确,因为 askme@mysite.com 是一个有效的电子邮件地址(使用 google 设置域)。
Return-path: <> Envelope-to: myuserid@myhostingprovider.com Delivery-date: Mon, 28 Jun 2010 12:37:28 -0400 Received: from mailnull by myhostingprovider.com with local (Exim 4.69) id UNIQUEIDZ-7x for myuserid@myhostingprovider.com; Mon, 28 Jun 2010 12:37:28 -0400 X-Failed-Recipients: askme@mysite.com Auto-Submitted: auto-replied From: Mail Delivery System <Mailer-Daemon@myhostingprovider.com> To: myuserid@myhostingprovider.com Subject: Mail delivery failed: returning message to sender Message-Id: <EUNIQUEIDZ-7x@myhostingprovider.com> Date: Mon, 28 Jun 2010 12:37:28 -0400 This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: askme@mysite.com No Such User Here ------ This is a copy of the message, including all the headers. ------ Return-path: <myuserid@myhostingprovider.com> Received: from nobody by myhostingprovider.com with local (Exim 4.69) (envelope-from <myuserid@myhostingprovider.com>) id UNIQUEIDV-6b for askme@mysite.com; Mon, 28 Jun 2010 12:37:28 -0400 To: askme@mysite.com Subject: mysite.com: SUBJECT / enduser@gmail.com X-PHP-Script: www.mysite.com/mysitescript.php for IPADDRESS MIME-Version: 1.0 Content-type: text/html; charset=UTF-8 From: mysite.com Service <askme@mysite.com> Message-Id: <EUNIQUEIDV-6b@myhostingprovider.com> Date: Mon, 28 Jun 2010 12:37:28 -0400