我得到了一個錯誤郵件:的smtplib無法發送郵件:550 5.7.1本系統配置爲拒絕虛假的發件人地址
[email protected]
Your message wasn't delivered due to a permission or security issue.
It may have been rejected by a moderator, the address may only accept e-mail
from certain senders, or another restriction may be preventing delivery.
smtp; 550 5.7.1 This system is configured to reject spoofed sender addresses> #SMTP#
Original message headers:
Return-Path: <[email protected]>
Received: from localhost.localdomain (unknown [192.X.X.X]) (using
TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client
certificate requested) by smtpcompany.tw (Postfix) with ESMTPS id CB8752E03B7 for
<[email protected]>; Fri, 2 Oct 2015 14:24:41 +0800 (CST)
Content-Type: multipart/mixed; boundary="===============1672092220=="
MIME-Version: 1.0
From: <[email protected]>
To: <[email protected]>
Subject: We got something
我堅持了這一段時間 我不知道其中ia錯
我嘗試smtplib.SMTP('smtp.gmail.com',587)
作品以及
但公司SMTP失敗
我覺得這條線是weild:
Received: from localhost.localdomain (unknown [192.X.X.X])
你有什麼想法嗎?
請幫我謝謝
這裏是代碼:
def send_email(mail_from,mail_to,subject, body):
import smtplib
from email.mime.multipart import MIMEMultipart
fromaddr = mail_from
toaddr = mail_to if type(mail_to) is list else [mail_to]
msg = MIMEMultipart()
msg['From'] = fromaddr
msg['To'] = ", ".join(toaddr)
msg['Subject'] = subject
body = body
server = smtplib.SMTP('mail.stmpcompany.tw', 25)
server.set_debuglevel(True)
server.starttls()
text = msg.as_string()
server.sendmail(fromaddr, toaddr, text)
server.quit()
你有沒有試過與postadmin交談呢? –
postadmin認爲這是代碼問題。我應該在我的電腦中安裝什麼? – user2492364
錯誤郵件中的'Original message headers'部分之前是否有任何內容? –