从一封邮件中获取多封电子邮件()...... [英] Getting multiple emails from a single mail()...

查看:120
本文介绍了从一封邮件中获取多封电子邮件()......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一个旧帖子( http:// groups。 google.com/group/alt.php/

browse_thread / thread / 751edb9c723316c4 / ea9bf92a9c6b807c?lnk = gst& q = mail()

+ duplicate& rnum = 7#ea9bf92a9c6b807c),但似乎没有

分辨率。我也注意到这是一个相当古老的线程,并且在搜索结果中似乎没有任何新的东西。


无论如何,我有一个非常相似的问题;每次PHP mail()调用我都会收到五封电子邮件。虽然这最初在一个产生大量电子邮件的循环中显示了

,但我明确地使用硬编码字符串进行了单个

直接邮件调用,并且我确认了相同的

行为。我今天大部分时间都在和这个打架,我可以自信地排除mail()函数被意外地多次调用
(除非PHP重新加载页面)多次

在最终渲染之前或其他东西真的很奇怪)


这是一个例子:


$ result = mail($ sendto,$ subject,$ messagebody,$ headers);


如果重要,可以通过包装函数调用,如下所示:


函数send_email($ email_from,$ email_to,$ subject,$ msg,

$ show_result = null)

{

...

$ headers =" From:$ from \\\\ nn" ;;

$ headers。=" Reply-To:$ from \\ n" ;;

...

$ result = mail($ sendto,$ subject,$ messagebody,$ headers);

...

}


vars的价值不重要,因为我用一个非常简单的邮件用

硬编码字符串a nd得到了完全相同的行为。


我已经进行了广泛的搜索,我似乎无法找到任何特别指出为什么会发生这种情况的事情。对于那些对

感兴趣的邮件标题,由一个mail()调用生成,这就是我得到的结果

(一些数据被删除):


########################

收到:来自XXXXX的crazycooter [67.110.67.194]。 marketnet.com

(SMTPD-9.10)id A208038C; 2007年8月1日星期三12:25:28 -0500

日期:2007年8月1日星期三12:25:17 -0500

主题:主题

致: YY*********@MarketNet.com

来自: AA*********@MarketNet.com

回复: AA*********@MarketNet.com

消息ID:< 200708011225863.SM03756@crazycooter>

X-RCPT-TO:< YY ********* @ MarketNet.com> ;

状态:

X-UIDL:471469545

X-IMail-ThreadID:c208071f0000b881

### #####################

收到:来自于XXXXX.marketnet.com的crazycooter [67.110.67.194]

(SMTPD-9.10)id A2020370; 2007年8月1日星期三12:25:22 -0500

日期:2007年8月1日星期三12:25:11 -0500

主题:主题

致: YY*********@MarketNet.com

来自: AA*********@MarketNet.com

回复: AA*********@MarketNet.com

消息ID:< 200708011225800.SM02212@crazycooter>

X-RCPT-TO:< YY ********* @ MarketNet.com> ;

状态:

X-UIDL:471469541

X-IMail-ThreadID:c20100e10000b872

### #####################

收到:来自于XXXXX.marketnet.com的crazycooter [67.110.67.194]

(SMTPD-9.10)id A20304C4; 2007年8月1日星期三12:25:23 -0500

日期:2007年8月1日星期三12:25:13 -0500

主题:主题

致: YY*********@MarketNet.com

来自: AA*********@MarketNet.com

回复: AA*********@MarketNet.com

消息ID:< 200708011225488.SM03132@crazycooter>

X-RCPT-TO:< YY ********* @ MarketNet.com> ;

状态:

X-UIDL:471469542

X-IMail-ThreadID:c20301a00000b875

### #####################

收到:来自于XXXXX.marketnet.com的crazycooter [67.110.67.194]

(SMTPD-9.10)id A20503A8; 2007年8月1日星期三12:25:25 -0500

日期:2007年8月1日星期三12:25:15 -0500

主题:主题

致: YY*********@MarketNet.com

来自: AA*********@MarketNet.com

回复: AA*********@MarketNet.com

消息ID:< 200708011225363.SM03132@crazycooter>

X-RCPT-TO:< YY ********* @ MarketNet.com> ;

状态:

X-UIDL:471469543

X-IMail-ThreadID:c20507190000b87a

### #####################

收到:来自于XXXXX.marketnet.com的crazycooter [67.110.67.194]

(SMTPD-9.10)id A20703A8; 2007年8月1日星期三12:25:27 -0500

日期:2007年8月1日星期三12:25:16 -0500

主题:主题

致: YY*********@MarketNet.com

来自: AA*********@MarketNet.com

回复: AA*********@MarketNet.com

消息ID:< 200708011225706.SM03132@crazycooter>

X-RCPT-TO:< YY ********* @ MarketNet.com> ;

状态:

X-UIDL:471469544

X-IMail-ThreadID:c20600e10000b87d

### #####################

我现在正在使用PHP 5通过WinXP盒(SP2)进行本地开发

IIS。如果重要的话,我必须配置IIS,使.html扩展名

映射到C:\ Progra~1 \PHP \ php5isapi.dll。对于GET,POST和HEAD

,因为这个客户端站点是带有嵌入式PHP的所有.html文件。 SMTP

是一个交换服务器。


我没有开发这个应用程序,但我确实需要支持它,所以任何

来自更有见识的人的指导将不胜感激。


问候,


CrazyCooter

I found an old thread on this (http://groups.google.com/group/alt.php/
browse_thread/thread/751edb9c723316c4/ea9bf92a9c6b807c?lnk=gst&q=mail()
+duplicate&rnum=7#ea9bf92a9c6b807c), but there didnt seem to be a
resolution. I also noticed that this was a pretty old thread and there
didn''t seem to be anything newer in the search results.

Regardless, I have a very similar problem; I am consistently getting
five emails per each PHP mail() call. While this originally showed up
in a loop generating a flood of email, I explicitly made a single
direct mail call using hard coded strings and I confirmed the same
behavior. I have spent most of today fighting with this and I can
confidently rule out that the mail() function is being accidentally
called multiple times (unless PHP is reloading the page multiple times
before finally rendering back or something else really bizarre)

Here is an example:

$result = mail($sendto, $subject, $messagebody, $headers);

If it matters, this is being called via a wrapper function, like this:

function send_email($email_from, $email_to, $subject, $msg,
$show_result = null)
{
...
$headers = "From: $from \r\n";
$headers .= "Reply-To: $from \r\n";
...
$result = mail($sendto, $subject, $messagebody, $headers);
...
}

The values of the vars don''t matter, as I ran a very simple mail with
hard coded strings and got exactly the same behavior.

I have searched extensively and I cant seem to find anything that
specifically nails down why this might happen. For those interested in
the mail headers generated by a single mail() call, here is what I get
(some data scrubbed out):

########################
Received: from crazycooter [67.110.67.194] by XXXXX.marketnet.com
(SMTPD-9.10) id A208038C; Wed, 01 Aug 2007 12:25:28 -0500
Date: Wed, 01 Aug 2007 12:25:17 -0500
Subject: Subject
To: YY*********@MarketNet.com
From: AA*********@MarketNet.com
Reply-To: AA*********@MarketNet.com
Message-Id: <200708011225863.SM03756@crazycooter>
X-RCPT-TO: <YY*********@MarketNet.com>
Status:
X-UIDL: 471469545
X-IMail-ThreadID: c208071f0000b881
########################
Received: from crazycooter [67.110.67.194] by XXXXX.marketnet.com
(SMTPD-9.10) id A2020370; Wed, 01 Aug 2007 12:25:22 -0500
Date: Wed, 01 Aug 2007 12:25:11 -0500
Subject: Subject
To: YY*********@MarketNet.com
From: AA*********@MarketNet.com
Reply-To: AA*********@MarketNet.com
Message-Id: <200708011225800.SM02212@crazycooter>
X-RCPT-TO: <YY*********@MarketNet.com>
Status:
X-UIDL: 471469541
X-IMail-ThreadID: c20100e10000b872
########################
Received: from crazycooter [67.110.67.194] by XXXXX.marketnet.com
(SMTPD-9.10) id A20304C4; Wed, 01 Aug 2007 12:25:23 -0500
Date: Wed, 01 Aug 2007 12:25:13 -0500
Subject: Subject
To: YY*********@MarketNet.com
From: AA*********@MarketNet.com
Reply-To: AA*********@MarketNet.com
Message-Id: <200708011225488.SM03132@crazycooter>
X-RCPT-TO: <YY*********@MarketNet.com>
Status:
X-UIDL: 471469542
X-IMail-ThreadID: c20301a00000b875
########################
Received: from crazycooter [67.110.67.194] by XXXXX.marketnet.com
(SMTPD-9.10) id A20503A8; Wed, 01 Aug 2007 12:25:25 -0500
Date: Wed, 01 Aug 2007 12:25:15 -0500
Subject: Subject
To: YY*********@MarketNet.com
From: AA*********@MarketNet.com
Reply-To: AA*********@MarketNet.com
Message-Id: <200708011225363.SM03132@crazycooter>
X-RCPT-TO: <YY*********@MarketNet.com>
Status:
X-UIDL: 471469543
X-IMail-ThreadID: c20507190000b87a
########################
Received: from crazycooter [67.110.67.194] by XXXXX.marketnet.com
(SMTPD-9.10) id A20703A8; Wed, 01 Aug 2007 12:25:27 -0500
Date: Wed, 01 Aug 2007 12:25:16 -0500
Subject: Subject
To: YY*********@MarketNet.com
From: AA*********@MarketNet.com
Reply-To: AA*********@MarketNet.com
Message-Id: <200708011225706.SM03132@crazycooter>
X-RCPT-TO: <YY*********@MarketNet.com>
Status:
X-UIDL: 471469544
X-IMail-ThreadID: c20600e10000b87d
########################

I am developing locally right now on a WinXP box (SP2) with PHP 5 via
IIS. If it matters, I had to configure IIS such that .html extensions
are mapped to "C:\Progra~1\PHP\php5isapi.dll" for GET,POST, and HEAD
since this clients site is all .html files with embedded PHP. The SMTP
is an exchange server.

I didn''t develop this app, but I do need to support it, so any
guidance from someone more knowledgeable would be greatly appreciated.

Regards,

CrazyCooter

推荐答案

result = mail(
result = mail(


sendto,


subject,


这篇关于从一封邮件中获取多封电子邮件()......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆