Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
63135 Lượt xem

Hi,

I've got some issues with SMTP.

In mail settings :

  • Smtp server: smtp.zoho.com
  • Port: 465
  • Security: SSL/TLS
  • User: account@mydomain.com
  • Password : *******

Test connexion button -> Connection test succeeded

In my account preferences > Email : account@mydomain.com

After sending an email, there is in the logs :

SMTPServerDisconnected: Connection unexpectedly closed Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_mail_server.py", line 463, in send_email

I succeed to send mails with a php script with same config on the same server.

  • Question 1: what is wrong with my configuration ?
  • Question 2: why there is no distinction between emails sent and email in error in web interface ?
Ảnh đại diện
Huỷ bỏ

Can you please send me complate traceback...?

Tác giả

The traceback was : > 2013-12-02 10:52:27,369 29708 ERROR mydomain openerp.addons.base.ir.ir_mail_server: Échec de l'envoi du courriel via le serveur SMTP 'smtp.zoho.com'.

> SMTPServerDisconnected: Connection unexpectedly closed

> Traceback (most recent call last):

> File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_mail_server.py", line 463, in send_email smtp.sendmail(smtp_from, smtp_to_list, message.as_string())

> File "/usr/lib/python2.7/smtplib.py", line 736, in sendmail self.rset()

> File "/usr/lib/python2.7/smtplib.py", line 460, in rset return self.doc

Câu trả lời hay nhất

This exception is raised when the server unexpectedly disconnects, or when an attempt is made to use the python mail SMTP instance before connecting it to a server. Clients sending outgoing mail should connect on port 587 and use starttls. To use port 465, you need to call smtplib.SMTP_SSL(). Currently, it calls smtplib.SMTP() .. so,change your PORT from 465 into 587 it. Also, you'll need to send the ehlo command before the starttls command, then again after the starttls command. 

http://net-informations.com/python/net/email.htm


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

problem arias because of port number. you have to check your thunderburd port number(if you are running server locally) in my case it is 587 add this port and you are good to go.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Domain Alias was set to mydomain.com. When set to 127.0.0.1 it works.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 15
5258
0
thg 3 25
987
0
thg 12 24
840
14
thg 5 24
234729
5
thg 9 24
12485