需要有关从linux服务器发送电子邮件的帮助。
def send_mail():
sendmail_location = "/usr/sbin/sendmail"
mail = os.popen("%s -t" % sendmail_location, "w")
mail.write("From: %s\n" % "my_mail@mail.com") #this is correct?
for key in data.keys():
mail.write("To: %s\n" % key)
print(key)
mail.write("Subject: test email script")
mail.write("\n")
for value in data.values():
mail.write(value)
print(value)
,但我的邮箱中没有电子邮件,也没有错误。 先感谢您。