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.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d04e88703859472428479673d7650a1516720affff423b323d9a501f924b3415 |
|
MD5 | 437a12b389298118053d99cde91062b2 |
|
BLAKE2b-256 | d9d7684414e491cf449de482c4704cec61abef85e19e947578a243eb2cf63e34 |