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 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题