2

嗨,我一直在寻找更高级的编码来编辑和发送电子邮件:

SERVER = "your.mail.server"
FROM = "yourEmail@yourAddress.com"
TO = ["listOfEmails"] # must be a list

SUBJECT = "Subject"
TEXT = "Your Text"

# Prepare actual message
message = """From: %s\r\nTo: %s\r\nSubject: %s\r\n\

%s
""" % (FROM, ", ".join(TO), SUBJECT, TEXT)

# Send the mail
import smtplib
server = smtplib.SMTP(SERVER)
server.sendmail(FROM, TO, message)
server.quit()

但是,我想让用户从下拉列表中选择要发送的电子邮件地址。我希望它经常使用:

mail.Open('Template1.oft')

并在使用用户输入发送之前对其进行编辑。有这样的吗?我一直在寻找没有成功。

欢呼 MK

4

0 回答 0