Sendmail client. send mail via stmp server.
Project description
python-sendmail
Sendmail client. send mail via stmp server.
Install
pip install python-sendmail
Installed Command Lines
- pysendmail
Help
test@test ~ % pysendmail --help
Usage: pysendmail [OPTIONS] [CONTENT]
Send mail.
Options:
-f, --from-address TEXT Mail sender, e.g. Name <name@example.com> or
name@example.com. [required]
-t, --to-address TEXT Mail recipients, e.g. Name <name@example.com> or
name@example.com. [required]
-s, --subject TEXT Mail subject
-a, --attach TEXT Mail attachments, allow multiple use.
--html Mail content is HTML format.
-e, --encoding TEXT Encoding of the mail content input.
-c, --charset TEXT Encoding of the mail content output.
-h, --host TEXT Mail server address, default to 127.0.0.1.
-p, --port INTEGER Mail server port, default to 25. If you are using
an ssl server, mostly the port should be 465.
--ssl Mail server using ssl encryption.
-u, --user TEXT Mail server login account. Empty user means don't
use login.
-P, --password TEXT Mail server login password. Empty password means
don't use login.
--verify Verify ssl certificate.
--help Show this message and exit.
使用案例
Send mail with auth, without attachment.
- Mail sender:sender@example.com
- Mail recipient: recipient@exmaple.com
- Subject:just a test mail
- Content:just a test mail
- Mail Server Address:stmp.example.com
- Mail Server Port:465
- Use ssl: yes
- Account: sender@example.com
- Password: senderPassword
- Attachment: None
pysendmail -h stmp.example.com -p 465 --ssl -u sender@example.com -P senderPassword -f 'SENDER <sender@exmaple.com>' -t recipient@exmaple.com -s 'just a test mail' 'just a test mail'
Send mail with attachment, without auth
- Mail sender:sender@example.com
- Mail recipient: recipient@exmaple.com
- Subject:just a test mail
- Content:just a test mail
- Mail Server Address:127.0.0.1
- Mail Server Port:25
- Use ssl: No
- Account: None
- Password: None
- Attachment: /path/to/attachment.pdf
pysendmail -f sender@exmaple.com -t recipient@exmaple.com -s 'just a test mail' -a /path/to/attachment.pdf 'just a test mail'
Releases
v0.3.4
- Doc update.
v0.3.3
- Fix ssl context problem.
- Add attach filename support.
v0.3.2
- Add verify option. By default python-sendmail will ignore the ssl verify.
v0.3.1
- Change help information to english.
- Use new style to release.
v0.3.0
- Old style release.
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
python-sendmail-0.3.4.tar.gz
(6.2 kB
view details)
Built Distribution
File details
Details for the file python-sendmail-0.3.4.tar.gz
.
File metadata
- Download URL: python-sendmail-0.3.4.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92e68c49b800f88e7aa25eba7f30e1cf7357a362deee6cce8da3fbcda0e82777 |
|
MD5 | 1a7da7e1009ba190b1ec457117e9d581 |
|
BLAKE2b-256 | f170676e1181f3577de611c3c747f15b777ce922c709d16bb21f58e8535efec4 |
File details
Details for the file python_sendmail-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: python_sendmail-0.3.4-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 504101c66df33c7731c42efe2d2642f4c00ea3ae6ce609650554527f07df7a53 |
|
MD5 | f03e29a1a2e0a5ea0791fb03ceceefc5 |
|
BLAKE2b-256 | f540a2f3f8850b6a06a9dc310daab320146e446f12c8714b08a6984e69bb12e1 |