通过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?
我正在通过WordPress构建一个网站,并在我自己的批量电子邮件中编码。 我使用插件来确保通过我的Gmail帐户真实地发送电子邮件。 我使用wp_mail来触发电子邮件。 p>
我的第一个策略是发送给:我自己和密送:每个人。 这给了太多收件人一个gmail错误。 p>
然后,我将电子邮件拆分为49个块,它运行良好。 现在,我正在创建一个取消订阅链接,我意识到我无法在电子邮件中包含收件人的电子邮件地址,因为这是与50人相同的电子邮件地址。 p>
是解决这个问题的最佳方法吗? 我可以发送给:数百名没有gmail的人对我感到不安吗? p> div>
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 $ :-)