Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
/ email-server Public archive

A small python email server meant for use with a gmail account

Notifications You must be signed in to change notification settings

scott-mcnulty/email-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

email-server

A small python email server meant to be used with a gmail account.

Set up

Create a virtual environment and install the packages:

virtualenv venv;

source venv/bin/activate;

pip install -r requirements.txt

Follow this guide to create oauth2 gmail account credentials.

Open the make_credentials.py script and replace YOUR_EMAIL_HERE with the gmail email you want to use. Run the script to have yagmail create your oauth2 gmail client credentials file.

python3 scripts/make_credentials.py

Now you can run the main application!

./run.sh

Sending an email

Hit the /email endpoint with a POST request using something like the example JSON below:

{
    "from": "[email protected]",
    "subject": "This is a test email",
    "content": "Here is the email content!"
}

Deploying to Heroku

If you have a Heroku account this email server can be deployed there using the shell deployment scripts in the scripts directory. Install the Heroku cli and log in. Next change the APP_NAME_HERE values from the shell scripts in the scripts directory with your application name. Lastly follow the steps below:

Build the app

./scripts/build-app.sh

Then release it

./scripts/release-app.sh

About

A small python email server meant for use with a gmail account

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published