简体   繁体   中英

sending email via django send_mail

I have been using django send_mail for a long while. however on a new project which use django 1.4 and I changed my dev machine I have a very strange problem.

when I call send_mail on the standard backend with all the settings (EMAIL_HOST='localhost' EMAIL_PORT=25,etc) I am getting the error :

  File "c:\python27\lib\site-packages\django\core\mail\backends\smtp.py", line 4
  8, in open local_hostname=DNS_NAME.get_fqdn())
  File "c:\python27\lib\smtplib.py", line 249, in __init__
  (code, msg) = self.connect(host, port)
  File "c:\python27\lib\smtplib.py", line 309, in connect
  self.sock = self._get_socket(host, port, self.timeout)
  File "c:\python27\lib\smtplib.py", line 284, in _get_socket
  return socket.create_connection((port, host), timeout)
  File "c:\python27\lib\socket.py", line 571, in create_connection
  raise err
  socket.error: [Errno 10013] An attempt was made to access a socket in a way forb
  idden by its access permissions

I have no clue what I am doing wrong, I have debugged it and it seems that the connect function recieve the right port and host however its getting forbidden. I suspected its maybe my antivirus but disabling it didnt help.

I am running on administrator privilages (UAC disabled) if anyone consider this to be the problem.

Strange. I changed my email server (python SMTPd) to port 1025 instead of 25 and everything back to normal....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM