PEAR Mail using gmail SMTP won't send 2 emails in sucession

淺唱寂寞╮ 提交于 2019-12-24 14:13:54

问题


I have PEAR Mail and Mail_mime all working very nicely using gmail's SMTP server to send. Thanks to some posts on here that helped me get that far!

But, in some scenarios, I need to send two emails, with different content, and to different recipients one right after the other. This is refusing to work.

I can confirm both the emails I am trying to send are well-formed and valid, as both will send with the other one commented out. But whenever I attempt to send them both, only the first gets through. I have tried putting php to sleep for 10 seconds in between, and I have tried sending the second email in a different script that gets called after the end of the first. Nothing.

I realise this is a pretty obscure problem as I found no other articles mentioning this. I haven't included any code because, as stated, I know the code works fine.

So I am hoping in vein that someone might have a bright idea as to why this might be.

Thanks in advance.


回答1:


SOLVED: changing

include('Mail.php'); 

to

require_once('Mail.php'); 

fixed the problem.



来源:https://stackoverflow.com/questions/9162859/pear-mail-using-gmail-smtp-wont-send-2-emails-in-sucession

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!