Skip to main content

Simple SMTP wrapper for Python's SMTP, supports both HTML and text based emails. Now supports attachments!

Project description

Simple SMTP wrapper for Python with basic HTML and text support based on MIME types.

Quickstart

Install simpleemail

pip install simpleemail

Then use it in a project:

from simpleemail import create_email_message, send_email

To send an email you have to first create an email message to send. Note you can use any combination of plain text or HTML when creating a message.

message = create_email_message('Hello','email@address.com','foo@bar.it','World!','<html><head></head><body><h1>World!</h1></body></html>') send_email(message,'smtp.server.com', False)

You can also provide parameters to be replaced when the message is created.:

params = {'name': 'Rick James'}
message = create_email_message('Hello',
                                'email@address.com',
                                'anyone@foobar.com',
                                '[name]!',
                                '<html><head></head><body><h1>[name]!</h1></body></html>',
                                params)

This will substitute the value of Rick James in for the name.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
simpleemail-0.3.1-py3-none-any.whl (3.6 kB) Copy SHA256 hash SHA256 Wheel py3 Jul 25, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page