Skip to main content

Pure python sendmail client.

Project description

Pure python sendmail client.

Install

pip install python-sendmail

Help

E:\python-sendmail>python sendmail.py --help
Usage: sendmail.py [OPTIONS] [CONTENT]

Send an email via command line.

Note:

If CONTENT is not provided in command line, will read it from STDIN.

Options:
-f, --from-address TEXT  Sender's mail address, e.g. Sender Name
                        <sender@exmaple.com> or sender@example.com
                        [required]
-t, --to-address TEXT    Recipient's mail address, e.g. Recipient Name
                        <recipient@exmaple.com> or recipient@example.com
                        [required]
-s, --subject TEXT       Mail subject
-a, --attach TEXT        Attachment file path, can use multiple times.
--html                   The content is html format
-e, --encoding TEXT      Encoding of the content, defaults to utf-8
-h, --host TEXT          Email server address
-p, --port INTEGER       Email server port
--ssl                    Email server use ssl
-u, --user TEXT          Login user
-P, --password TEXT      Login password
--help                   Show this message and exit.

Usage

SENDER(sender@exmaple.com) send an email to recipient@exmaple.com, mail subject is ‘just a test mail’ and mail content is ‘just a test mail’.

sendmail -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'

SENDER(sender@exmaple.com) send an email to recipient@exmaple.com, mail subject is ‘just a test mail’, mail content is ‘just a test mail’, and with an attachment file named ‘attachment.pdf’

sendmail -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' -a /path/to/attachment.pdf 'just a test mail'

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

python-sendmail-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file python-sendmail-0.1.1.tar.gz.

File metadata

  • Download URL: python-sendmail-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for python-sendmail-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1c8b251da132cfc36db503b6f409b516d994907ad38930f2c1d7015c867a7352
MD5 3cc76e66db045128f506b26083d51f93
BLAKE2b-256 d7c64161e40f05a2f049273df9baaf019b73079b6c2e2718d4cdcef39869a508

See more details on using hashes here.

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