PacktPublishing / Django-4-by-example

Django 4 by example (4th Edition) published by Packt
https://djangobyexample.com/
MIT License
818 stars 461 forks source link

How Can i solve smtp problems #18

Open bantu94 opened 2 years ago

bantu94 commented 2 years ago

from django.core.mail import send_mail send_mail('Django mail', 'This e-mail was sent with Django', 'blog3160@gmail.com', ['blog3160@gmail.com'],fail_silently=False) Traceback (most recent call last): File "C:\Users\Eddie\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 398, in getreply line = self.file.readline(_MAXLINE + 1) File "C:\Users\Eddie\AppData\Local\Programs\Python\Python310\lib\socket.py", line 705, in readinto return self._sock.recv_into(b) ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "C:\Users\Eddie\blogEnv\lib\site-packages\django\core\mail__init__.py", line 87, in send_mail return mail.send() File "C:\Users\Eddie\blogEnv\lib\site-packages\django\core\mail\message.py", line 298, in send return self.get_connection(fail_silently).send_messages([self]) File "C:\Users\Eddie\blogEnv\lib\site-packages\django\core\mail\backends\smtp.py", line 124, in send_messages new_conn_created = self.open() File "C:\Users\Eddie\blogEnv\lib\site-packages\django\core\mail\backends\smtp.py", line 87, in open self.connection.starttls( File "C:\Users\Eddie\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 769, in starttls self.ehlo_or_helo_if_needed() File "C:\Users\Eddie\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 611, in ehlo_or_helo_if_needed if not (200 <= self.ehlo()[0] <= 299): File "C:\Users\Eddie\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 452, in ehlo (code, msg) = self.getreply() File "C:\Users\Eddie\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 401, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed: " smtplib.SMTPServerDisconnected: Connection unexpectedly closed: [WinError 10054] An existing connection was forcibly closed by the remote host

zenx commented 1 year ago

@bantu94 could a local firewall be causing problems?

bantu94 commented 1 year ago

Perhaps ,How may i over it please,or is it okay if i just continue?