8000 Fix usage of SMTP() class · python/webhook-mailer@35c814b · GitHub
[go: up one dir, main page]

Skip to content

Commit 35c814b

Browse files
committed
Fix usage of SMTP() class
1 parent 80537e9 commit 35c814b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mailer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async def fetch_diff(client, url):
8080

8181
async def send_email(smtp, message):
8282
async with smtp as server:
83-
await server.connect(hostname=SMTP_HOSTNAME, port=SMTP_PORT, use_tls=False)
83+
await server.connect()
8484
await server.login(SMTP_USERNAME, SMTP_PASSWORD)
8585
return (await server.send_message(message))
8686

@@ -133,7 +133,7 @@ def application(loop=None, smtp=None):
133133
if loop is None:
134134
loop = asyncio.get_event_loop()
135135
if smtp is None:
136-
smtp = aiosmtplib.SMTP(hostname=SMTP_HOSTNAME, port=SMTP_PORT, loop=loop)
136+
smtp = aiosmtplib.SMTP(hostname=SMTP_HOSTNAME, port=SMTP_PORT, loop=loop, use_tls=False)
137137
app = aiohttp.web.Application(loop=loop)
138138
app.router.add_post('/', create_handler(
139139
lambda: aiohttp.ClientSession(loop=loop),
@@ -143,6 +143,6 @@ def application(loop=None, smtp=None):
143143

144144
if __name__ == '__main__':
145145
loop = asyncio.get_event_loop()
146-
smtp = aiosmtplib.SMTP(hostname=SMTP_HOSTNAME, port=SMTP_PORT, loop=loop)
146+
smtp = aiosmtplib.SMTP(hostname=SMTP_HOSTNAME, port=SMTP_PORT, loop=loop, use_tls=False)
147147
app = application(loop, smtp)
148148
aiohttp.web.run_app(app, port=PORT)

0 commit comments

Comments
 (0)
0