fix 25 port no reach /. problem

This commit is contained in:
cyy_mac
2026-03-24 23:02:28 +08:00
parent 2503b8b85c
commit e3b4085552

View File

@@ -19,6 +19,7 @@ class EmailNotifier:
self.smtp_password = config['smtp_password']
self.to_email = config['to_email']
self.use_tls = config.get('use_tls', True)
self.use_ssl = config.get('use_ssl', False)
def send(self, notifications):
"""发送邮件通知"""
@@ -39,6 +40,9 @@ class EmailNotifier:
msg.attach(MIMEText(html_body, 'html', 'utf-8'))
try:
if self.use_ssl:
server = smtplib.SMTP_SSL(self.smtp_host, self.smtp_port)
else:
server = smtplib.SMTP(self.smtp_host, self.smtp_port)
if self.use_tls:
server.starttls()