outbox is simplest SMTP client you'll ever see. It's 100% synchronous...
Usage
Give your app an outbox easily:
from outbox import Outbox, Email, Attachment
outbox = Outbox(username='username', password='password',
server='server', port=1234, mode='SSL')
outbox.send(Email(subject='my subject', body='some nice sentiment'), [
Attachment('kittens.jpg', filepath='/path/to/kittens.jpg'),
Attachment('my-transient-file.bin', raw='some raw data'),
])
outbox.send(Email(subject='my subject', body='< b >SOME REALLY NICE SENTIMENT< /b >', type='html'), [
Attachment('kittens.jpg', filepath='/path/to/kittens.jpg'),
Attachment('my-transient-file.bin', raw='some raw data'),
])
Installation
Installing Outbox.py is simple:
pip install outbox
What is new in this release:
- Handle passing a single recipient as a string, instead of forcing the recipient to be a list.
- Handle utf8 email properly. Thanks, Zhang Mingyuan! I doubt I've covered every use case, so the charset to use can be passed in when constructing an Email.
- Added a sender_address method to the Outbox class, for when the username used for authentication isn't good enough.
What is new in version 0.1.3:
- Made a few lines of code a bit easier to follow. No functional changes.
- Updated the license to actually hold copyright in my name, instead of Kenneth Reitz. Does this mean he owned copyright on the library up until now? Can I even change the license? I'm unsure.
What is new in version 0.1.2:
- Made Outbox a context manager, so it can be used with the with statement. As noted in the example, this has the added benefit of performing a single login to send all emails, you should get better performance using a with statement.
- Removed raw and filepath arguments to Attachment. They were both begging to point to a file-like object, so that's what you have now - an argument called fileobj
- Fixed annoying encoding error when trying to send binary attachments.
- The Email object does not have a type argument anymore. Instead, there is body and html_body, so you can send an email with both html and plain-text bodies.
Requirements:
- Python
Comments not found