I have a script that creates a csv file that I need to also send in an email as an attachment. I haven't been able to find a working example of how to do this so far. Is there "standard" code to do this? Can someone provide a good example of how to do this? Any help would be much appreciated. Thanks.
Asked
Active
Viewed 130 times
0
-
search before you create a new question! Your exact issue is described and solved in this SO-question: http://stackoverflow.com/questions/3362600/how-to-send-email-attachments-with-python – theAlse Apr 18 '13 at 07:11
-
1I'v actually already tried that example, but it didn't work for me. It's also 3 years old and was wondering if there was an updated answer or newer code. – user2234571 Apr 18 '13 at 07:17
-
what environment are you using? I have previously used the mail-command in Linux and simply called it from python. – theAlse Apr 18 '13 at 07:20
-
Linux 2.6.32-358.2.1.el6. Are you talking about the mailx command? I see -a gives you the ability to attach a file. – user2234571 Apr 18 '13 at 07:32
-
yes, I run the command from python and it has worked fine to send attachment. – theAlse Apr 18 '13 at 07:37