dsrjs86444 2019-02-01 17:56
浏览 346
已采纳

通过WordPress发送批量电子邮件的最佳做法

I am building a site through WordPress and coded in my own bulk email. I used a plugin to ensure that emails are sent authentically through my gmail account. I use wp_mail to trigger the email.

My first strategy was to send to: myself and bcc: everyone. This gave a gmail error for too many recipients.

Then, I split the email into chunks of 49, and it worked well. Now, I’m creating an unsubscribe link and I realized that I have no way to include the recipients email address in the email because it’s the same email bcc’d to 50 people.

What is the best approach to solve this problem? Can I send to: hundreds of people without gmail getting upset at me?

  • 写回答

1条回答 默认 最新

  • doupo5178 2019-02-02 07:50
    关注

    No, usually you can't send hundreds of mails just like that, you will be blocked and it may have repercussions like having your domain-name credibility hurt for a long time.

    there are several ways:

    Ask your Hoster about his stance. For example, my Hoster allows 1 Mail every 1.5 seconds in average. I'm using a cronjob that calls a wordpress endpoint in which i loop thru several 1000 emails (legit newsletters), each loop 2 seconds of break. this is just an example, it doesn't make quite sense, but the important part is: set the timeout fresh on each loop, set a sleep. i tested this with 100000 mails and it worked without a hitch on the website.

    for ($i = 1; $i <= $total; $i++) {
       set_time_limit(20);
       sleep(2);
       wp_mail($email, $subject, $body);  //i set up an smtp plugin for this
    }
    

    Another, and frankly more professional solution, is using a service like mailgun.com, there you can hammer as many mails thru their API as you want. But of course, it costs some $ :-)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题