this is dvsnier email.
Project description
README
this is a simple email sending program, providing two ways: SMTP and SMTP SSL abstract modules with dev version.
One. preconditions
- only plain text email is supported
Two. the email config
the please create a new conf
folder in the current project directory, Then create a new email_config.cfg
or email_ssl_config.cfg
file
- this your project root
| - .
| - ..
| + conf
| - email_config.cfg // smtp config files
| - email_ssl_config.cfg // smtp ssl config files
|
| + src
| + ...
|
| + tests
| + ...
|
| - .gitignore
| - LICENSE.txt
| - MANIIFEST.in
| - pyproject.toml
| - README.md
| - setup.cfg
| - setup.py
| - tox.ini
| ...
since the
conf
folder contains private information, please add the directory to the .gitignore file.
2.1 smtp config
# set up server
mail_host = smtp.xxx.com
# server default port that is 25
mail_port = 25
# user name
mail_user = xxx@gmail.com
# password
mail_pass = your_password_or_token
# sender
mail_sender = xxx@gmail.com
sender_alias = sender_alias
# receiver
mail_receiver = yyy@163.com
receiver_alias = receiver_alias
2.2 smtp ssl config
# set up server
mail_host = smtp.xxx.com
# server default port that is 465/994
mail_port = 465
# user name
mail_user = xxx@gmail.com
# password
mail_pass = your_password_or_token
# sender
mail_sender = xxx@gmail.com
sender_alias = sender_alias
# receiver
mail_receiver = yyy@163.com
receiver_alias = receiver_alias
Three. usage
# -*- coding:utf-8 -*-
from com.dvsnier.email.email import Email
email = Email()
# smtp cfg file
email.config_file('conf/email_config.cfg')
# smtp ssl cfg file
# email.config_file('conf/email_ssl_config.cfg')
# true is smtp ssl way, otherwise smtp
email.init(True)
# email.init()
email.builderText('subject', 'content')
email.sendmail()
email.quit()
Four. explain
since it is only a development version
, only text mode
is provided at present, and the attachment of multimedia mode is supported in the future
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
Built Distribution
Close
Hashes for com.dvsnier.email-0.0.1.dev1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4c8e3eb2ccc183394c692aa0aa0b9c7b6f37ff9cdf3f425e71b75f16d05d975 |
|
MD5 | b017765738250b5ddfb87af600f30214 |
|
BLAKE2b-256 | 64188fbe2f3e957a4c3b767867698d3ba5014fa5d229d52bbf83366b7b06d1e4 |
Close
Hashes for com.dvsnier.email-0.0.1.dev1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b041ec94952642b6faf397cd7f084b01ceb616c9ce5d0af985c31fffc2558d07 |
|
MD5 | 4fb09ee82b7274a7d1c5416646fbf777 |
|
BLAKE2b-256 | 02a7a4792e9e4bfe6772e179a380c42ec97dba9c78fde9e9091013b069a3f827 |