Skip to content

capitalistlion/gmail_python_function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gmail Python Function

Python function for sending emails using gmail (or other providers)

Requirements

  • Gmail Account
  • Python
  • Pip

Setup

  1. Create a virtual environment
python -m venv venv
  1. Activate the virtual environment
./venv/scripts/activate
  1. Install requirements
pip install -r requirements.txt
  1. Replace EMAIL_FROM and app_password with your gmail (or other provider's) details. You can follow these instructions for Gmail

Gmail Link

    EMAIL_FROM = "youremail@gmail.com"
    app_password = "000000000000" # you can create an app password from your gmail account security settings
  1. Replace "example@gmail.com" with the email to send
response = send_email("example@gmail.com", [], "Testing Function", "Hi there. It's working well")
  1. Run the function
python app.py

testing

About

A Python function for sending emails using gmail (or other providers)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages