Skip to content

duckworthd/chainmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

chainmail

chainmail is a Python library for constructing and sending email.

Installation

$ pip install chainmail

Usage

import chainmail

message = (
  chainmail.Message()
  .sender("source@example.com")
  .recipient("destination@example.com")
  .subject(u"実例")                 # look Ma, unicode "just works"!
  .body(u"これはテストなんですよ")
  .attachment("chainmail.py")
  .attachment("test.py")
)

smtp = (
  chainmail.SMTP()
  .host("smtp.example.com")
  .port(587)
  .username("USER")
  .password("PASSWORD")
)

print message
print smtp

smtp.send(message)

Text Encoding

All text is forcibly encoded as unicode via BeautifulSoup's UnicodeDammit class. If your message is looking garbled, try encoding it unicode before attaching it.

About

Email in Python made easy!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages