PHP-Script for sending personalized html newsletters

I searched for a simple solution to send some personalized html e-mails with embedded pictures. However I didn’t find one. Thus I created the following script:

It uses phpmailer and a simple csv-file to generate and send the emails. To execute it you just need to upload it to a server and execute it with:

To add new recipients you can open the file recipients.csv in Microsoft Excel or LibreOffice and add new rows. When you save it just select the CSV-Format and choose the tabulator character as deliminator.

The generated email in this example looks like this:

It can be freely adapted in the code. You just need to escape ” with \”

Download the code