msg.attach multiple attachments and passing vars to html

aurfalien at gmail.com aurfalien at gmail.com
Tue Aug 31 19:24:26 EDT 2010


Hi,

Few questions as I've been at this for dayz.

Can I do multiple attachments in order via msg.attach as so;

part1 = MIMEText(html, 'html')
msg.attach(part1)
part2 = MIMEText(text, 'plain')
msg.attach(part2)
part3 = MIMEText(html, 'html')
msg.attach(part3)

I desire to attach part1, part2 and part3 in that order.

Also, is it somehow possible to pas python vars to html?

My goal to to have an email that says something like;

Welcome to ACME.

A few LINKS to get you started.

Your user name is USRNM and your password is PASS

Where USRNM and PASS are python vars but the rest is an html based  
email.

LINKS is an actual hyperlink, hence the desire to do html based emails.

Thanks in advance,

- aurf



More information about the Python-list mailing list