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.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82aa77b933e11725af76daa93bc4ba722de65749968d89ced9d3aab2c7eaeb58 |
|
MD5 | 95b68d83de6e7ab4c77d8d230f221786 |
|
BLAKE2b-256 | 4a0a565faee29312898f67d2a15062b6fec4df2ada834137d80056322d1aaafc |