Skip to content

A module that makes sending (valid) emails from python a little bit easier.

License

Notifications You must be signed in to change notification settings

mfussenegger/easymail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easymail

travis-ci

Wheel

PyPI Version

Python Version

The email package in pythons standard library is pretty low level. Easymail aims to add an abstraction layer on top that sets some (hopefully) sane defaults.

These defaults include:

  • using utf-8 encoding by default.
  • important headers (like Date)

A simple example:

from easymail import Email
from smtplib import SMTP
e = Email('My Name <mymail@somedomain.com>', 'recipient@otherdomain.org')
e.subject = 'hello world'
e.body = 'with some non-äscii charöcters'

smtp = SMTP('mymailserver.com')
smtp.sendmail(*e.args)

Slightly more advanced:

from easymail import Email, Attachment
from smtplib import SMTP
e = Email('My Name <mymail@somedomain.com>', 'recipient@otherdomain.org')
e.subject = 'hello world'
e.body = 'with some non-äscii charöcters'

e.attachments.append(Attachment('./path/to/picture.png'))
e.attachments.append(Attachment('./path/to/document.pdf'))

smtp = SMTP('mymailserver.com')
smtp.sendmail(*e.args)

Dependencies

Pure Python 3.5+

About

A module that makes sending (valid) emails from python a little bit easier.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages