i have a python script and would like to know how to email the output of the script in python.
i can do it from the command line(kshell) with in *nix but would like something like this in the script.
somescript.py; echo "test" | mailx john_smith@xyz.com
axn 0 Light Poster
Recommended Answers
Jump to PostSomething like the following is a simple example and usually works. If not, then you will have to Google for your specific sendmail app.
fromaddr = "<me@localhost>" toaddrs = "<you@localhost>" msg = "Test of Python's sendmail\n" # The actual mail send part server = smtplib.SMTP('localhost') server.set_debuglevel(1) server.sendmail(fromaddr, …
All 2 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.