| 85 | |
| 86 | The same can also be done with a single python script: |
| 87 | {{{ |
| 88 | #!python |
| 89 | import sys |
| 90 | import smtplib |
| 91 | |
| 92 | torrent_id = sys.argv[1] |
| 93 | torrent_name = sys.argv[2] |
| 94 | save_path = sys.argv[3] |
| 95 | |
| 96 | subject = "Some subject" |
| 97 | message = """Put your message here |
| 98 | |
| 99 | It can span multiple lines. It can also contain information by specifying |
| 100 | %(torrent_id)s or %(torrent_name)s""" % { |
| 101 | 'torrent_id': torrent_id, |
| 102 | 'torrent_name': torrent_name, |
| 103 | 'save_path': save_path |
| 104 | } |
| 105 | |
| 106 | msg = "Subject: %s\n\n%s" % (subject, message) |
| 107 | |
| 108 | smtp = smtplib.SMTP('smtp.myisp.com') |
| 109 | smtp.sendmail('fromemail@domain.com', 'myemail@domain.com', message) |
| 110 | }}} |