我成功地能夠使用smtplib模塊發送電子郵件。但是,當emial發送時,它不包括髮送電子郵件中的主題。Python:使用smtplib模塊發送電子郵件時未顯示「主題」
import smtplib
SERVER = <localhost>
FROM = <from-address>
TO = [<to-addres>]
SUBJECT = "Hello!"
message = "Test"
TEXT = "This message was sent with Python's smtplib."
server = smtplib.SMTP(SERVER)
server.sendmail(FROM, TO, message)
server.quit()
我應該如何編寫「server.sendmail」以在發送的電子郵件中包含SUBJECT。
如果我使用,server.sendmail(發件人,收件人,郵件,分科),它提供了錯誤關於 「smtplib.SMTPSenderRefused」
的作品就像一個魅力,MERCI –