Some of the information here may be outdated, please check the book instead
[edit]

Yes, you can, here is an example

# import required modules
from gluon.tool import Mail

# configure Mailer
mail=Mail()
mail.settings.server='smtp.gmail.com:587'
mail.settings.sender='...@somewhere.com'
mail.settings.login=None or 'username:password'

context=dict(a=1,b=2,c=3,etc="etc")
message=response.render('file.html',context)

# send the message
mail.send(to=['who@example.com'],subject='None',message=message)

Here context is a dictionary that contains variables visible by the template file.

Massimo

© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.