It is my pleasure to announce TurboMail 1.0, a TurboGears extension
to add multi-threaded outbound mail functionality to your TurboGears
application.
What is TurboMail?
------------------
TurboMail is a TurboGears extension - meaning that it starts up and
shuts down alongside TurboGears applications you write in the same
way that visit tracking and identity do. TurboMail uses built-in
Python modules for SMTP communication and MIME e-mail creation, but
greatly simplifies these tasks by performing the grunt-work for you.
Being multi-threaded, TurboMail allows you to enqueue messages to be
sent and then immediately continue with processing, resulting in a
much more fluid user experience. Threads are handled intelligently
(increasing the number of threads as demand increases) and they are
automatically recycled. There is only ever one SMTP connection per
thread.
Installing TurboMail
--------------------
Simply easy_install the package:
easy_install TurboMail
TurboMail installs no external scripts.
Using TurboMail
---------------
Before you can send mail, you must enable TurboMail and configure a
server. This is done from your dev.cfg, prod.cfg, or app.cfg by
placing the following in the general section:
mail.on = True
mail.server = "smtp.myserver.net"
mail.username = None
mail.password = None
Set username and password only if your outgoing mail server require
them. Once TurboMail is configured, import 'turbomail' into your
controller's Python file and use the following code to send a simple
plain-text message:
message = turbomail.Message(
'[EMAIL PROTECTED]',
'[EMAIL PROTECTED]',
'Subject'
)
message.plain = "Plain text body."
turbomail.enqueue(message)
To send a message using a KID template:
message = turbomail.TemplateMessage(
'[EMAIL PROTECTED]',
'[EMAIL PROTECTED]',
'Subject',
'application.templates.path',
dict(wanted="An argument.")
)
turbomail.enqueue(message)
The final argument to the TemplateMessage constructor is a dictionary
of arguments to pass to the KID template. Callable values will be
resolved (executed) just prior to being sent.
For additional information, visit the API reference:
http://www.topfloor.ca/turbomail/documentation/reference/
Matthew Bevan, Systems Administrator
Top Floor Computer Systems Ltd.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---