[問題] mail hinet 寄信被阻擋

看板Python作者 (渾沌與秩序)時間10年前 (2015/12/21 11:00), 編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/1
大家好 由於專案需求我必須針對使用者做寄信通知 程式碼如下 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

12/21 11:40, , 1F
你要確認 mail.XXX.com.tw 那台機器本身有允許讓你
12/21 11:40, 1F

12/21 11:40, , 2F
主機所在的 ip 有開放 mail relay 功能
12/21 11:40, 2F

12/22 12:57, , 3F
謝謝K大!!,確實是伺服器設定上的問題:)
12/22 12:57, 3F
文章代碼(AID): #1MTsjYWj (Python)
文章代碼(AID): #1MTsjYWj (Python)