简体   繁体   English

PHP的邮件功能有多个收件人的问题?

[英]php mail function having issues with multiple recipients?

PHP mail function works fine if all the addresses are valid and sends mail to each one of them but in case any of the email id is not valid (i mean does not exist) The mail function does not works. 如果所有地址均有效,则PHP邮件功能可以正常工作并将其发送到每个地址,但是如果任何电子邮件ID无效(我的意思是不存在),则邮件功能将无法正常工作。 Has anyone faced similar problem is there a fix for the same or should i try validating all the email id's existence myself. 有没有人遇到过类似的问题,是否有相同的解决方法,还是我自己尝试验证所有电子邮件ID的存在?

just loop all the addresses - should work independent then. 只是循环所有地址-然后应该独立工作。 (Except you NEED to show everybody all recipients) (除非您需要向所有人显示所有收件人)

    foreach ($emails as $email){
      //do mail stuff.
    }

You can also add some error handling to collect the invalid addresses then. 您还可以添加一些错误处理以收集无效地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM