Hi David,

I have a crm app from which I send html mails using the following
function:

def mail():
    m_list=db(...).select(...)
    for item in m_list:
        context=dict(item=item)
        message=response.render('mail/mail.html',context)
        recipient=item.email
 
boolean=mail.send(to=[recipient],subject='...',message=[None,message])
        if boolean:
            db.mailingstats.insert(...)
        else:
            db.adminstats.insert(...)
    return True

The boolean stuff isn't a necessity but it gives me feedback on the
process, and I use the mailingstats table for statistical purposes.

If you're sending html mails make sure the layout is all tables, and
put the css in the body not in the head. If you need an example I'll
post a view.


Kind regards,

Annet.

Reply via email to