I'm trying to notify all emails in some list on some event. Here's the code:
mail = AIOSMTP(SENDER_EMAIL, PASSWORD)
for admin in EMAILS_TO_NOTIFY:
await mail.send(to=admin, contents=NOTIFICATION_TEXT)
await mail.close()
Here's exception trace:
Traceback (most recent call last):
File "venv/lib/python3.11/site-packages/telethon/client/updates.py", line 570, in _dispatch_update
await callback(event)
File "main.py", line 62, in main
await mail.send(to=admin, contents=NOTIFICATION_TEXT)
File "venv/lib/python3.11/site-packages/aioyagmail/aio.py", line 51, in send
return await self._attempt_send(recipients, msg_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv/lib/python3.11/site-packages/aioyagmail/aio.py", line 57, in _attempt_send
result = await self.smtp.sendmail(self.user, recipients, msg_string)
^^^^^^^^^
AttributeError: 'AIOSMTP' object has no attribute 'smtp'
I'm trying to notify all emails in some list on some event. Here's the code:
Here's exception trace:
What am I doing wrong?