When trying to send the message form docker worker container it's not sending it's getting connection timeout 110

I have all the firewall port active, tried telnet and other to test connectivity to smtp server it's giving response, also when trying to send the mail in django with send_mail() it's able to sending but when trying to send mail using from django.core.mail import EmailMessage send() it's getting connection timeout 110 the i also increase the timeout to 60s by increasing it in django setting.py for email backend still when trying to send mail it's showing this log error

return self.get_connection(fail_silently).send_messages([self])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/matrixadm/.local/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line       134, in send_messages
    sent = self._send(message)
           ^^^^^^^^^^^^^^^^^^^
   File "/home/matrixadm/.local/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 152, in _send
    self.connection.sendmail(
   File "/usr/local/lib/python3.11/smtplib.py", line 902, in sendmail
    (code, resp) = self.data(msg)
                   ^^^^^^^^^^^^^^
   File "/usr/local/lib/python3.11/smtplib.py", line 580, in data
    (code, msg) = self.getreply()
                  ^^^^^^^^^^^^^^^
   File "/usr/local/lib/python3.11/smtplib.py", line 398, in getreply
    line = self.file.readline(_MAXLINE + 1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/local/lib/python3.11/socket.py", line 706, in readinto
    return self._sock.recv_into(b)

I tried to send mail but it's showing connection timeout 110 error

Back to Top