Pārlūkot izejas kodu

Fix: `Email` error. (#6701)

### What problem does this PR solve?

#6695

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.18.0
Kevin Hu pirms 7 mēnešiem
vecāks
revīzija
61c0dfab70
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4
    1
      agent/component/email.py

+ 4
- 1
agent/component/email.py Parādīt failu

logging.info(f"Connecting to SMTP server {self._param.smtp_server}:{self._param.smtp_port}") logging.info(f"Connecting to SMTP server {self._param.smtp_server}:{self._param.smtp_port}")
context = smtplib.ssl.create_default_context() context = smtplib.ssl.create_default_context()
with smtplib.SMTP_SSL(self._param.smtp_server, self._param.smtp_port, context=context) as server:
with smtplib.SMTP(self._param.smtp_server, self._param.smtp_port) as server:
server.ehlo()
server.starttls(context=context)
server.ehlo()
# Login # Login
logging.info(f"Attempting to login with email: {self._param.email}") logging.info(f"Attempting to login with email: {self._param.email}")
server.login(self._param.email, self._param.password) server.login(self._param.email, self._param.password)

Notiek ielāde…
Atcelt
Saglabāt