私のサーバーがユーザーに電子メールを送信しようとしているときに、このエラーメッセージが表示されます。Python - 電子メールのエラー接続タイムアウトを送信
エラーログメッセージ
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 177, in __call__
response = self.get_response(request)
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 230, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 284, in handle_uncaught_exception
'request': request
File "/usr/lib64/python2.7/logging/__init__.py", line 1175, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/lib64/python2.7/logging/__init__.py", line 1268, in _log
self.handle(record)
File "/usr/lib64/python2.7/logging/__init__.py", line 1278, in handle
self.callHandlers(record)
File "/usr/lib64/python2.7/logging/__init__.py", line 1318, in callHandlers
hdlr.handle(record)
File "/usr/lib64/python2.7/logging/__init__.py", line 749, in handle
self.emit(record)
File "/usr/lib/python2.7/site-packages/django/utils/log.py", line 117, in emit
self.send_mail(subject, message, fail_silently=True, html_message=html_message)
File "/usr/lib/python2.7/site-packages/django/utils/log.py", line 120, in send_mail
mail.mail_admins(subject, message, *args, connection=self.connection(), **kwargs)
File "/usr/lib/python2.7/site-packages/django/core/mail/__init__.py", line 97, in mail_admins
mail.send(fail_silently=fail_silently)
File "/usr/lib/python2.7/site-packages/django/core/mail/message.py", line 292, in send
return self.get_connection(fail_silently).send_messages([self])
File "/usr/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 100, in send_messages
new_conn_created = self.open()
File "/usr/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 58, in open
self.connection = connection_class(self.host, self.port, **connection_params)
File "/usr/lib64/python2.7/smtplib.py", line 255, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib64/python2.7/smtplib.py", line 315, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib64/python2.7/smtplib.py", line 290, in _get_socket
return socket.create_connection((host, port), timeout)
File "/usr/lib64/python2.7/socket.py", line 571, in create_connection
raise err
socket.error: [Errno 110] Connection timed out
[pid: 16437|app: 0|req: 71/132] 88.157.165.166() {54 vars in 1125 bytes} [Wed Sep 6 10:02:03 2017] POST /company/accounts/register/ => generated 0 bytes in 254703 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
私のコード
send_mail('New employer account created', '''New account has been created on XXXXX!
Company Name: ''' + user_profile.company_name + '''
Contact Person: ''' + user_profile.name + '''
Email: ''' + user_profile.user.email + '''
Phone No: ''' + user_profile.company_phone_number + '''
- XXXXX''', '[email protected]', ['[email protected]'], fail_silently=False)
してくださいアドバイス。ありがとうございました。
あなたが使っているsmtpはありますか? –
私はZOHOを使用しています。 –