sending a file as an attachment with smtplib

S

Stephen Boulet

Is it possible to send a file as an attachment using smtplib?

--

Stephen

If your desktop gets out of control easily,
you probably have too much stuff on it that
doesn't need to be there.
Donna Smallin, "Unclutter Your Home"
 
P

Peter Hansen

Stephen said:
Is it possible to send a file as an attachment using smtplib?

Of course, but smtplib is just for sending raw data, not for
formatting the message itself. For that you need the "email"
module. Look in the docs for it, and specifically for the
examples, which include "Here's an example of how to send a
MIME message containing a bunch of family pictures that may
be residing in a directory:"

-Peter
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top