msg.attach multiple attachments and passing vars to html

A

aurfalien

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top