我已经集成了以下库:
import mysql.connector import random import requests from requests.auth import HTTPBasicAuth import smtplib, ssl from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart 每次我想通过smtplib发送电子邮件时,都会收到以下错误消息
Traceback (most recent call last): File "plesk.py", line 236, in sendConfirmationEmail() File "plesk.py", line 148, in sendConfirmationEmail with smtplib.SMTP_SSL("******************", 465, context=context) as server: File "/usr/lib/python3.5/smtplib.py", line 1021, in init source_address) File "/usr/lib/python3.5/smtplib.py", line 251, in init (code, msg) = self.connect(host, port) File "/usr/lib/python3.5/smtplib.py", line 335, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib/python3.5/smtplib.py", line 1029, in _get_socket server_hostname=self._host) File "/usr/lib/python3.5/ssl.py", line 385, in wrap_socket _context=self) File "/usr/lib/python3.5/ssl.py", line 760, in init self.do_handshake() File "/usr/lib/python3.5/ssl.py", line 996, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.5/ssl.py", line 641, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720) 如果我现在注释掉mysql.connector,则再次发送电子邮件
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。