pyzsendmail manual page — Python easy mail library v0.9.8 documentation

### Navigation

- index
- pyzmail home »

# pyzsendmail manual page

## Synopsis

pyzsendmail [options]

## Description

pyzsendmail compose and send mails.

Compose an email including text and/or HTML content, add attachments of any kind, or embed images in the HTML content. Depending the need, pyzsendmail adapts the MIME structure of the email.

pyzsendmail handle SSL, TLS and authentication.

pyzsendmail can send to one or multiple recipients, but also support CC and BCC recipients.

## Options

`-h````,` `--help```

  show this help message and exit

`-H` `name_or_ip``,` `--smtp-host``=name_or_ip`

  SMTP host relay

`-p` `port``,` `--smtp-port``=port`

  SMTP port (default=25)

`-L` `login``,` `--smtp-login``=login`

  SMTP login (if authentication is required)

`-P` `password``,` `--smtp-password``=password`

  SMTP password (if authentication is required)

`-m` `mode``,` `--smtp-mode``=mode`

  smtp mode in ‘normal’, ‘ssl’, ‘tls’. (default=’normal’)

`-A` `charset``,` `--arg-charset``=charset`

  command line arguments charset (default=<depend of the host locals>)

`-C` `charset``,` `--mail-charset``=charset`

  mail default charset (default=<depend of the host local>)

`-f` `sender``,` `--from``=sender`

  sender address

`-t` `recipient``,` `--to``=recipient`

  add one recipient address

`-c` `recipient``,` `--cc``=recipient`

  add one CC address

`-b` `recipient``,` `--bcc``=recipient`

  add one BCC address

`-s` `subject``,` `--subject``=subject`

  message subject

`-T` `text``,` `--text``=text`
  text content in the form
    [text_charset]:@filename
  or
    [text_charset]:”litteral content”

`-M` `html``,` `--html``=html`
  html content in the form
    [text_charset]:@filename
  or
    [text_charset]:”literal content”

`-a` `file``,` `--attach``=file`
  add an attachment in the form:
    maintype/subtype:filename:target_file[:text_charset]
  for example
    image/jpg:picture.jpg:C:\thepicture.png
  or
    text/plain:file.txt:C:\report.txt:[windows-1252]

`-e` `file``,` `--embed``=file`
  add embedded data in the form:
    maintype/subtype:content-id:target_file[:text_charset]
  for example
    image/jpg:picture:C:\thepicture.png

`-E````,` `--eicar```

  include eicar virus in attachments, for testing Anti-virus

## Arguments

login and password must be utf-8 encoded if they contains non us-ascii
  characters.
address can be of the form:

  “Foo Bar <foo.bar@example.com>”

  or

  “foo.bar@example.com”

  Name can contain non us-ascii characters. They are supposed to use the command line charset encoding.

text and HTML content can be in the literal form:
  - :”The text content”
  - utf8:”The text content”

  In both samples, the content is encoded using the encoding of the command line argument. In first sample, notice the : at beginning, the content will be encoded using the mail default charset, in the second sample, the text will be re-encoded into utf8.

  or using content of a file:

  - :@”C:\file.txt”
  - windows-1252:@”C:\file.txt”

  In first sample, notice the : at beginning, the file is supposed to be encoded using mail default charset and will be encoded this way in the email. In second sample, the file is supposed to be encoded using windows-1252 charset and will be encoded this way in the email.

attachment and embedded files
  In attachment and embedded content, the text_charset is used only if the maintype is ‘text’. The file is supposed to be encoded using text_charset and will be encoded using this charset in the email.

## Samples

pyzsendmail -H localhost -p 25 -f “Me <me@example.com>” -t “foo@example.com” -t “Bar <bar@example.com” -s “The subject” -T :”Hello world” -a image/jpg:holiday.png:C:\Holiday.png

## See also

pyzmailinfo(1).

## Author

Alain Spineux <alain.spineux@gmail.com>

### Navigation

- index
- pyzmail home »