看板 Python 關於我們 聯絡資訊
大家好 由於專案需求我必須針對使用者做寄信通知 程式碼如下 def SendMail(strRecipient,strSubject,strContent): s = smtplib.SMTP('mail.XXX.com.tw') s.set_debuglevel(1) msg = MIMEMultipart('alternative') msg.attach(MIMEText(strContent, 'plain')) sender = 'notice@ekc.com.tw' msg['Subject'] = strSubject msg['From'] = sender msg['To'] = strRecipient try: try: s.sendmail(sender, strRecipient, msg.as_string()) finally: s.quit() except smtplib.SMTPRecipientsRefused, e: print >> DEBUGSTREAM, 'got SMTPRecipientsRefused' refused = e.recipients 我寄其他人的如gmail信箱是正常寄信 但是遇到hinet.net的信箱則遇到了問題 Relaying denied. Proper authentication required 我系統使用centos 6.4 python 2.7 相信是某個設定有問題 但很抱歉我搜尋很久依然找不出問題來 希望大家能幫忙我找出問題 謝謝大家:) -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.124.29.189 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1450666850.A.82D.html
kenduest: 你要確認 mail.XXX.com.tw 那台機器本身有允許讓你 12/21 11:40
kenduest: 主機所在的 ip 有開放 mail relay 功能 12/21 11:40
aaa7513231: 謝謝K大!!,確實是伺服器設定上的問題:) 12/22 12:57