以下代码可在另一台计算机上正常运行:
SELECT ST_Buffer(
ST_GeomFromText(
'LINESTRING(50 50,150 150,150 50)'
), 10, 'endcap=round join=round');
运行以下部分时:
def send_email(user, pwd, recipient, subject, body):
#lb.send_email('AlirezaFedEx@gmail.com','P&ENLAMS','info@nka-it.com','Test','This is a test')
import smtplib
FROM = 'AlXXX@gmail.com'
TO = ['info@XXX.com'] # recipient if isinstance(recipient, list) else [recipient]
SUBJECT = 'Test'#subject
TEXT = 'This is a test' #body
# Prepare actual message
message = """From: %s\nTo: %s\nSubject: %s\n\n%s
""" % (FROM, ", ".join(TO), SUBJECT, TEXT)
try:
server = smtplib.SMTP('smtp.gmail.com',587)
server.ehlo()
server.starttls()
server.login(user, pwd)
server.sendmail(FROM, TO, message)
server.close()
print('successfully sent the mail')
except Exception as err:
print("failed to send mail:" + str(err))
它开始冻结,并最终出现以下错误:
TimeoutError:[WinError 10060]连接尝试失败,因为一段时间后连接方未正确响应,或者由于连接的主机未能响应而建立连接失败
我检查了浏览器的代理并禁用了代理,但仍然收到错误。有什么建议吗?
答案 0 :(得分:0)
您正在使用代理吗?如果是这样,请禁用该代理,然后重试。如果您有有效的互联网连接,这应该可以正常工作。