Skip to content

nicholasamorim/txmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

txmail

Defer your emails using Twisted.

Examples

from txmail.smtp import Sender

subject = 'An Example of Life and Love and Emails'
body = 'Hey ya'
from_email = '[email protected]'
name = 'Tx Mail'

sender = Sender(
    smtp_server, 
    username, 
    password, 
    port=587, 
    starttls=True, 
    from_name=name, 
    from_email=from_email
)

d = sender.send(['[email protected]', '[email protected]'], subject, body)
d.addCallback(_email_sent)

And yes, we support attachment(s).

attachments = ('pulpnonfiction.txt', 'lifeaftergod.md')
d = sender.send(
    ['[email protected]', '[email protected]'], 
    subject, body, attachments=attachments)
d.addCallback(_email_sent)

For more, take a look at the docs.

About

Defer your emails.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages