Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to test a batch email script

Tags:

html

email

I have a php mail script sitting on a LAMP vps server. The script grabs about 1000 email addresses and sends them each an html email.

I tested the script with about half a dozen of my own test email accounts and things worked fine. But I am concerned something may go wrong when I actually use this script for 1000 emails. Some things I would like to test for are

1) Confirm all 1000 emails were sent and received

2) Test to make sure emails did not end up in people's spam folders

3) Detect any other general failures

Does anyone have suggestions on how I can test for the above cases? I would like to read about your experiences building batch email scripts.

like image 244
John Avatar asked Oct 15 '22 06:10

John


2 Answers

You can use some kind of dummy SMTP Server. I Prefer : Dumbster this small server written in java works like an normal smtp but stores the emails in the filesystem.

I think you cant verify that your mail is not marked as spam. Only solution is to provide a backlink wich the users has to click.

like image 175
opHASnoNAME Avatar answered Oct 27 '22 01:10

opHASnoNAME


There is no good solution for making sure your emails reached their destination. Best things you can do are

  • set the BCC field of your mails to an address of your own where you can easily check programmatically the incoming mails -> so you have a double-check that your mail server is sending the mails outward

  • set the Reply-To field to another address of your own where you can check any bounced mails. Unfortunately, most mail mail servers today do not give you a reply if the mail address isn't valid since they don't want to support spammers by letting them check which of their mail addresses are real.

By the way, are you sure you are not considered to be a spammer by yourself when you sending mass mails like this?

like image 44
Doc Brown Avatar answered Oct 27 '22 00:10

Doc Brown