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.
show this help message and exit
SMTP host relay
SMTP port (default=25)
SMTP login (if authentication is required)
SMTP password (if authentication is required)
smtp mode in ‘normal’, ‘ssl’, ‘tls’. (default=’normal’)
command line arguments charset (default=<depend of the host locals>)
mail default charset (default=<depend of the host local>)
add one recipient address
add one CC address
add one BCC address
include eicar virus in attachments, for testing Anti-virus
“Foo Bar <email@example.com>”
Name can contain non us-ascii characters. They are supposed to use the command line charset encoding.
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:
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.
pyzsendmail -H localhost -p 25 -f "Me <me\@example.com>" -t "foo\@example.com" -t "Bar <bar\@example.com" -s "The subject" -T :"Hello" -a image/jpg:holiday.png:C:\\Holiday.png