How Do I get my Python script to attach multiple files and send as a single email
Joel Goldstick
joel.goldstick at gmail.com
Thu Aug 8 15:32:28 EDT 2013
On Thu, Aug 8, 2013 at 3:19 PM, Gary Herron
<gary.herron at islandtraining.com> wrote:
> On 08/08/2013 12:05 PM, wachkama at gmail.com wrote:
>>
>> I have a dilemma I cant figure out how to send multiple files as an
>> attachment to my email using this script. I can only send a single file
>> attachment . Help!!! Here is my script.
>> All filename's are txt files.
>>
>>
>>
>
> 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.
>
> Gary Herron
>
> --
> http://mail.python.org/mailman/listinfo/python-list
Here is a good example:
http://stackoverflow.com/questions/3362600/how-to-send-email-attachments-with-python
I found it using the following google search: "python send email using
smtp with multiple attachment"
It was the second result.
Google is your friend ;)
--
Joel Goldstick
http://joelgoldstick.com
More information about the Python-list
mailing list