Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Yet Another GMAIL client

Project description

yagmail is a GMAIL/SMTP client that aims to make it as simple as possible to send emails.

Sending an Email is as simple:

import yagmail
yag = yagmail.SMTP()
contents = [
    "This is the body, and here is just text http://somedomain/image.png",
    "You can find an audio file attached.", '/local/path/to/song.mp3'
yag.send('', 'subject', contents)

# Alternatively, with a simple one-liner:
yagmail.SMTP('mygmailusername').send('', 'subject', contents)

Note that yagmail will read the password securely from your keyring, see the section on Username and Password in the repository’s README for further details. If you do not want this, you can initialize yagmail.SMTP like this:

yag = yagmail.SMTP('mygmailusername', 'mygmailpassword')

but honestly, do you want to have your password written in your script?

For further documentation and examples, please go to

The full documentation is available at

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
yagmail-0.11.214-py2.py3-none-any.whl (17.8 kB) Copy SHA256 hash SHA256 Wheel 3.7
yagmail-0.11.214.tar.gz (17.3 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page