Skip to content

This is a python script to send emails to multiple users using threading to send emails to respective persons

Notifications You must be signed in to change notification settings

josh-boat365/py-mail-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-mail-script

This is a python script to send emails to multiple users using threading to send emails to respective persons

Usage

Install the following to run the script

pip install 
pip flask 
pip flask-mail 
pip python-dotenv

App Config

Create a .env file in the root folder to set the configuration for mail script.

This is how your .env file should look like

APP_SECRET = 'Generate random characters for your application key'

MAIL_SERVER = smtp.gmail.com
MAIL_PORT = 465
MAIL_USE_SSL = True
MAIL_USERNAME = [email protected]
MAIL_PASSWORD = Test123


# whiles mail is being sent copy these mails
COPY_TO_MAILS=['[email protected]', '[email protected]','[email protected]','[email protected]','[email protected]']

How to set up gmail smtp

  1. Sign in to your Gmail Account
  2. Search for App Passwords and click on it to open a tab.
  3. Select Other(Custom name) from the Select app dropdown.
  4. Give a name to the App (ex. Mail Script)
  5. Click on Generate to get password to be used for the Mail Script App.
  6. To use your Gmail Account in third-party apps and testing purposes : Mail: [email protected] Password: Generated app password from gmail.

How to run

python app.py

About

This is a python script to send emails to multiple users using threading to send emails to respective persons

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published