Skip to main content

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

email_broadcasting-0.1.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

email_broadcasting-0.1.2-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page