This script automates the process of sending emails through the Office 365 API using a Python script (o365_email_sender.py
). It reads recipient details from a CSV file (companies_info.csv
) and uses an HTML email template (email_template.txt
) to craft content. It is aimed at automating email outreach and is a robust tool for businesses and individuals.
- Python 3.x
- An Office 365 account with API access enabled
- The O365 Python package
- Clone this repository.
- Install the required dependencies:
- Directly via pip:
pip install O365
- Or from the
requirements.txt
file:pip install -r requirements.txt
- Directly via pip:
- Insert your Office 365 API client_id and client_secret into the o365_email_sender.py.
- Ensure the
o365_token.txt
is present for storing authentication tokens. - Update email_template.txt and companies_info.csv with your specific email content and recipient information.
- Populate the CSV file with target recipient details, including columns for name, email, etc.
- Customise the email template as necessary.
- Run the script with the command:
python o365_email_sender.py
- Secure authentication with the Office 365 API.
- Dynamic email content using a customisable HTML template.
- Recipient management via CSV.
- Test mode for validation.
- Automated email sending with adjustable delays to prevent rate limiting.
- Generates a report (
email_report.txt
) detailing the outcomes of the email dispatch process.
Contributions to improve or extend the functionality are highly encouraged. Please fork the repository and submit pull requests for any proposed changes or fixes.
This project is distributed under the MIT License. Refer to the LICENSE file for more information.