In 2016, Gmail still permitted emails to be sent programmatically, which opened up interesting opportunities for automated outreach. My project aimed to automate email campaigns by integrating an email harvester and sending thousands of targeted emails to potential employers.
The core of this setup was the PHPmailer library, which handled sending emails at fixed intervals to avoid drawing unnecessary attention or being flagged as spam. To further enhance deliverability, I used Gmail's trusted servers, minimizing the chances of emails being marked as spam. Additionally, I limited the number of CC and BCC recipients in each email to maintain credibility.
To add randomness and personalization, the code would dynamically mix recipient emails across various countries (e.g., .se, .fi, .uk) and select different cover letters for each message. The emails were sent in HTML format, embedding a Google Analytics pixel to track open rates and engagement metrics.
In this project, the PHP script was triggered on a Windows environment using a cron job alternative, which scheduled and automated the email sending process. This setup ensured a continuous workflow by generating a log file that recorded essential details like the number of emails sent, delivery status (success or failure), and any errors encountered during the process.
The logging system provided a comprehensive overview, allowing for easy monitoring and troubleshooting of the automated campaign.