top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to send multiple attachment using Python script.

0 votes
486 views

I have a dilemma I cant figure out how to send multiple files as an attachment to my email using python script. I can only send a single file attachment .

posted Aug 8, 2013 by Mandeep Sehgal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

There is a standard Python module named "email" which you should look at. It can build an email with all the parts, alternates, and attachments you want. Then you send the resulting message using your smtplib code. The email module is large and complex, but reasonably easy to learn (following the documentation examples). It's far, FAR, easier than rolling your message, especially when attachments are needed.

answer Aug 8, 2013 by Deepankar Dubey
Similar Questions
+2 votes

How we can send mail with attachment in Python? Is it any prerequisite for it?

+1 vote

How can I change the template file for getting attachments that are attached from bugzilla to any person who are on the CC list for the bug.

+1 vote

I wish to generate some test data for a program that deals with emails. I need something that can produce multi-part emails, including "broken" emails that violate email standards, especially when it comes to Unicode.

Does anyone know of something like this that already exists? It's not necessary for the package to actually send the emails, dumping them into an mbox is sufficient.

...