Skip to content

kayceenuel/emailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Sender Script

This is a simple Python script for sending personalized emails to a list of contacts using Gmail's SMTP server. The script supports the use of environment variables for storing sensitive information like email credentials.

Features

  • Sends emails to multiple contacts listed in a contacts.txt file.
  • Uses a customizable email template from a message.txt file.
  • Supports placeholders in the template for personalized content.
  • Credentials are loaded securely from a .env file.
  • Basic error handling for missing data and invalid contact entries.

Requirements

  • Python 3.x
  • smtplib (built-in Python library)
  • python-dotenv (to load environment variables)

Installation__+

  1. Clone this repository:

    git clone https://github.com/kayceenuel/emailer.git
    cd emailsender
  2. Install the required Python package:

    pip install python-dotenv
  3. Create a .env file in the project directory and add your Gmail credentials:

    [email protected]
    PASSWORD=your-app-password
    
  4. Prepare your contacts.txt file with the email addresses and personalized data:

    [email protected], Name1, AdditionalData1
    [email protected], Name2, AdditionalData2
    
  5. Create your message.txt file with the email subject and body:

    Subject Line Here
    
    Dear {0},
    
    Your personalized message goes here. Your additional data: {1}.
    
    Best regards,
    Your Name
    

Usage

Run the script with Python:

python main.py

About

mass emailer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages