socket.gaierror: [Errno 11001] getaddrinfo failed

前端 未结 8 1955
北海茫月
北海茫月 2021-01-06 08:33

I have tried to attached a file to the mail using python. Code:

import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIME         


        
8条回答
  •  没有蜡笔的小新
    2021-01-06 09:03

    The problem is that the DNS lookup for 'smtp server name' is failing - if this is your exact code then you can see why - if not and you have the valid qualified name for the SMTP server then you may have issues with the firewall/internet connection, etc., also port has to be set to a valid value to match your servers SMTP configuration, (usually port 25 but not absolutely always).

提交回复
热议问题