Отправка сообщения

date = time.strftime("%Y-%m-%d %H:%M")
sendmail_location = "/usr/sbin/sendmail"  # sendmail location
p = os.popen("%s -t" % sendmail_location, "w")
p.write("From: %s\n" % "root@navodki.ru")
p.write("To: %s\n" % "info@bustep.ru")
p.write("Subject: Marge indexers complite\n")
p.write("\n")  # blank line separating headers from body
p.write("Date: "+date)
status = p.close()
if status != 0:
        print "Sendmail exit status", status
04 марта 2018, 10:33    88



Наверх