Implement simple email broadcasting interface.
Project description
Stack:
Installation
pip install email-broadcasting
Usage
Asyncio with SSL
import asyncio
from email_broadcasting import MailBroadcasterAsyncSmtpSSL
async def main():
config = dict(
login=EMAIL_SERVER_LOGIN,
password=EMAIL_SERVER_PASSWORD,
host=EMAIL_SERVER_HOSTNAME,
port=EMAIL_SERVER_PORT,
)
mailer = MailBroadcasterAsyncSmtpSSL(**config)
await mailer.send_emails(
recipients=[LIST_OF_RECIPIENTS],
subject=EMAIL_SUBJECT,
body=EMAIL_BODY,
send_from=EMAIL_SENT_FROM,
)
if __name__ == '__main__':
asyncio.run(main())
Sync with SSL
from email_broadcasting import MailBroadcasterSyncSmtpSSL
def main():
config = dict(
login=EMAIL_SERVER_LOGIN,
password=EMAIL_SERVER_PASSWORD,
host=EMAIL_SERVER_HOSTNAME,
port=EMAIL_SERVER_PORT,
)
mailer = MailBroadcasterSyncSmtpSSL(**config)
mailer.send_emails(
recipients=[LIST_OF_RECIPIENTS],
subject=EMAIL_SUBJECT,
body=EMAIL_BODY,
send_from=EMAIL_SENT_FROM,
)
if __name__ == '__main__':
main()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for email_broadcasting-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fd3000218e1efb6432a1aea4ec10da58d2dac6a3ec6abe114f25f84de5d1ecc |
|
MD5 | 245947d498668caa576750d31bddc466 |
|
BLAKE2b-256 | a90deda92f27fa4398d66512878543a6e854f22a2711fc5a3c61fd6eeff7b9cd |