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.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93cbee98b199f3a1ad5f417e04e6e69dcc61160b28396eeb285eb7948244a470 |
|
MD5 | 09c0643379d79756b072345b98898148 |
|
BLAKE2b-256 | 2f7a6c71324802bf6b6d82f3e7d2f0c227626adfcc91e60282b543bc7bf42c8a |