email_handler.py¶
As simple an interface for email as seems viable.
>>> import email_handler
>>> bm = email_handler.BatchMailer('rgfowler@mdanderson.org', 'Package tester')
>>> response = bm.send_simple_mail('Batch mailer test', 'a better test')
>>> assert(const.EMPTY == response)
-
class
email_handler.BatchMailer(alias=None, domain='mdanderson.org', sender=None, recipients=None, mailhost='mail.mdanderson.org')[source]¶ A very simple mailer that sets up a standard “mail chute” to drop simple messages in so that it can be referenced in arbitrary places in a package (specifically SyQADA) without having to track the sender or recipient list
sender the address from which the mail will come, or current user if not specified
alias the alias to be displayed for the sender if not None
recipients a list of recipient email addresses. If None, then the sender duplicate addresses will be purged.
address is used (common usage would be to notify the user of a process when it completes.
mailhost the SMTP host through which the mail will be routed.
-
email_handler.DOMAIN= 'mdanderson.org'¶ The default domain attached to a bare unix userid
-
email_handler.MAILHOST= 'mail.mdanderson.org'¶