Monday, 9 May 2016

What is the simplest way to send an email with an attachment using Python?



What is the simplest way to send an email with an mp3 attachment using Python? I've written scripts in the past which used a pipe to sendmail to send basic email messages, but I've never bothered with attachments before.



Thanks in advance.


Answer



Use email package. It's pretty simple.



In the URL I linked, you'll find straight examples on how to do just that.




Hope it helps.


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...