A very simple class to send e-mails using the SMTP Python Lib
Project description
A very simple class to send e-mails using the Python SMTP standard lib.
Usage
from simplesmtp import SimpleSMTP
mail = SimpleSMTP(
host='mail.host',
username='user@mail.host',
passw='password',
from_email='You <youremail@mail.host>'
)
mail.send(to_email='email@example.com', subject='Hello', email_message='World')
Using SSL
from simplesmtp import SimpleSMTP
mail = SimpleSMTP(
host='mail.host',
username='user@mail.host',
passw='password',
from_email='You <youremail@mail.host>',
port=465,
use_ssl=True
)
mail.send(to_email='email@example.com', subject='Hello', email_message='World')
HTML messages
from simplesmtp import SimpleSMTP
mail = SimpleSMTP(
host='mail.host',
username='user@mail.host',
passw='password',
from_email='You <youremail@mail.host>'
)
mail.send(
to_email='email@example.com',
subject='Hello',
email_message='<html> HTML source with optional embedded images ... </html>',
msg_type='html'
)
Changing default from_email
from simplesmtp import SimpleSMTP
mail = SimpleSMTP(
host='mail.host',
username='user@mail.host',
passw='password',
from_email='You <youremail@mail.host>'
)
mail.send(
from_email='Another From <email@example.com>',
to_email='email@example.com',
subject='Hello',
email_message='World'
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simplesmtp-0.0.1.tar.gz
(8.4 kB
view hashes)
Built Distribution
Close
Hashes for simplesmtp-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8eb59e01cffb569621a9ea98958b6812af5f5f3b8b6cfd4337d5f634c9948cf |
|
MD5 | d96bbe00743cb66a767c5c14eb6bf3f5 |
|
BLAKE2b-256 | df84acf73b66eaece2db1e2abca1c6b9d200c1a6ed229b6c18343996f5779e04 |