You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
330 B

import smtplib
import sys
import mailconfig as cnf
server = smtplib.SMTP(cnf.mailserver, 25)
if (len(sys.argv) < 3):
print "usage: "+sys.argv[0]+" 'subject' 'body text'"
msg = "Subject: " + sys.argv[1] + "\n\n" + sys.argv[2]
server.sendmail(cnf.mailsource, cnf.maildestination, msg)