Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.03 KB

README.md

File metadata and controls

52 lines (35 loc) · 1.03 KB

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 = "[email protected]"
    app_password = "000000000000" # you can create an app password from your gmail account security settings
  1. Replace "[email protected]" with the email to send
response = send_email("[email protected]", [], "Testing Function", "Hi there. It's working well")
  1. Run the function
python app.py

testing