MAILSEND(1)

πŸ“¦ version 1.19, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

mailsend β€” okay bestie, this is the mailsend(1) page, and it is literally a command line program to send mail via SMTP protocol. πŸ’Œ

πŸ’Œ SYNOPSYS πŸ’Œ

Yes, the heading says SYNOPSYS β€” we are keeping the original spelling, don't come for me πŸ’…. Here's the whole vibe:

Version: @(#) mailsend v1.19

Copyright: BSD. It is illegal to use this software for Spamming

(Compiled with OpenSSL version: OpenSSL 1.0.2f  28 Jan 2016)
usage: mailsend [options]

Where the options are:

  • -copyright β€” show copyright information.
  • -4 β€” force to use IPv4 address of SMTP server.
  • -6 β€” force to use IPv6 address of SMTP server.
  • -smtp hostname/IP* β€” hostname/IP address of the SMTP server.
  • -port SMTP port β€” SMTP port.
  • -domain domain β€” domain name for SMTP HELO/EHLO.
  • -t to,to..* β€” email address/es of the recipient/s.
  • -cc cc,cc.. β€” carbon copy address/es.
  • +cc β€” do not ask for Carbon Copy.
  • -ct seconds β€” connect timeout. Default is 5 seconds.
  • -read-timeout seconds β€” read timeout. Default is 5 seconds.
  • -bc bcc,bcc.. β€” blind carbon copy address/es.
  • +bc β€” do not ask for Blind carbon copy.
  • +D β€” do not add Date header.
  • -f address* β€” email address of the sender.
  • -sub subject β€” subject.
  • -list_address file β€” a file containing a list of email addresses.
  • -log file β€” write log messages to this file.
  • -cs character set β€” for text/plain attachments (default is us-ascii).
  • -separator character β€” separator used with -attach. Default is comma (,). If used must be specified before -attach.
  • -enc-type type β€” encoding type. base64, 8bit, 7bit etc. Default is base64. Special type is "none".
  • -aname name β€” name of the attachment. Default is filename.
  • -content-id id β€” content-id in the attachment.
  • -mime-type type β€” MIME type.
  • -dispostion val β€” "attachment" or "inline". Default is "attachment".
  • -attach file,mime_type,[i/a] (i=inline,a=attachment) β€” attach this file as attachment or inline.
  • -show-attach β€” show attachment in verbose mode, default is no.
  • -show-mime-types β€” show the compiled in MIME types.
  • -M "one line msg" β€” attach this one line text message.
  • -content-type type β€” Content type. Default: multipart/mixed.
  • -msg-body path β€” Path of the file to include as body of mail.
  • -embed-image image β€” Path of image to embed in HTML.
  • -H "header" β€” Add custom Header.
  • -name "Full Name" β€” add name in the From header.
  • -v β€” verbose mode.
  • -V β€” show version info.
  • -w β€” wait for a CR after sending the mail.
  • -rt email_address β€” add Reply-To header.
  • -rrr email_address β€” request read receipts to this address.
  • -rp β€” return-path address.
  • -ssl β€” SMTP over SSL.
  • -starttls β€” use STARTTLS if the server supports it.
  • -auth β€” try CRAM-MD5,LOGIN,PLAIN in that order.
  • -auth-cram-md5 β€” use AUTH CRAM-MD5 authentication.
  • -auth-plain β€” use AUTH PLAIN authentication.
  • -auth-login β€” use AUTH LOGIN authentication.
  • -user username β€” username for ESMTP authentication.
  • -pass password β€” password for ESMTP authentication.
  • -example β€” show examples.
  • -ehlo β€” force EHLO.
  • -info β€” show SMTP server information.
  • -help β€” shows this help.
  • -q β€” quiet.

The options with * must be specified β€” like, mandatory, bestie. No skipping. πŸ’…

Environment variables:

  • SMTP_USER_PASS for plain text password (-pass).

✨ DESCRIPTION ✨

mailsend is a simple command line program to send mail via SMTP protocol for Windows, Linux/Unix. It's giving small-but-mighty terminal energy, honestly.

For deatils, please look at the web page: <http://muquit.com/muquit/software/mailsend/mailsend.html>.

πŸŽ€ EXAMPLES πŸŽ€

Examples of mailsend Version: @(#) mailsend v1.17b15. Yes, the examples say v1.17b15 even though the main version is v1.19 β€” I'm just the messenger, don't yell at me 😭.

Show server info

mailsend -v -info -port 587 -smtp smtp.gmail.com
mailsend -v -info -ssl -port 465 -smtp smtp.gmail.com

STARTTLS + AUTHENTICATION

mailsend -to user@gmail.com -from user@gmail.com
-starttls -port 587 -auth
-smtp smtp.gmail.com
-sub test +cc +bc -v
-user you -pass "your_password"

Note: Password can be set by env var SMTP_USER_PASS instead of -pass.

SSL + AUTHENTICATION

mailsend -to user@gmail.com -from user@gmail.com
-ssl -port 465 -auth
-smtp smtp.gmail.com
-sub test +cc +bc -v
-user you -pass "your_password"

As -auth is specified, CRAM-MD5, LOGIN, PLAIN will be tried in that order. Use -auth-cram-md5, -auth-plan, -auth-login for specific auth mechanism.

Note: Password can be set by env var SMTP_USER_PASS instead of -pass.

One line messages

One line messages are specified with -M. Each message can have its own MIME type, character set and encoding type:

mailsend -f user@example.com -smtp 10.100.30.1
-t user@example.com -sub "testing oneline messages"
-cs "us-ascii"
-enc-type "7bit"
-M "This is a test"

-cs "iso-8859-1"
-enc-type "8bit"
-M "Das Vetter ist schA~Xn!"

-cs "Big5"
-enc-type "base64"
-M "aeXaeXXaeXXeXX"

Attachments

Only requirement of -attach is the path of the file. All other attributes can be specified before -attach with appropriate flags. Note: The flags must be specified correctly for each attachment, otherwise the one specified in previous attachment will be used. Like, do not let your attachment flags ghost you, bestie.

By default MIME type is guessed from filename extension, default encoding type base64 is used:

mailsend -f user@example.com -smtp 10.100.30.1
-t user@example.com -sub "this is a test"
-attach "file.pdf" -attach "file.jpg"

But all espects of attachments can be controlled:

mailsend -f user@example.com -smtp 10.100.30.1
-t user@example.com -sub test
 -mime-type "text/plain"
 -enc-type "7bit"
 -charset "us-ascii"
 -attach "file.txt"

 -enc-type "8bit"
 -charset "iso-8859-1"
 -attach "deutsch.txt"

-mime-type "image/gif"
-enc-type "base64"
-aname "flower.gif"
-attach "/usr/file.gif"

-mime-type "image/jpeg"
-enc-type "base64"
-attach "file.jpeg"

By default, content disposition of all atachments are attachment, use -disposition "inline" to give hint to the mail reader to display it as mail body. Look at FAQ# 1 for details.

Including a body

Only one file can be included as a body of the mail. If the file is not us-ascii, the SMTP server has to support it. If you include a binary file, result is undefined. Like, undefined is not a vibe β€” be careful.

mailsend -f user@gmail -t user@example.com -smtp smtp.gamil.com
 -port 587 -starttls -auth -user user@gmail.com -pass secret
 -charset "utf-8"
 -mime-type "text/plain"
 -msg-body "file.txt"

πŸ¦‹ SEE ALSO πŸ¦‹

Please look at the web page for latest version and documentation: <http://muquit.com/muquit/software/mailsend/mailsend.html>.

πŸ‘‘ LICENSE πŸ‘‘

Legal bestie time β€” here is the license text verbatim:

Copyright (C) 2001-2016  Muhammad Muquit (http://www.muquit.com/)

 o Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

 o Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

 o Neither the name of the author MUHAMMAD MUQUIT (http://www.muquit.com/)
nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

πŸ’– AUTHOR πŸ’–

mailsend is written by Muhammad Muquit <muquit@muquit.com>. Homepage: <http://www.muquit.com/>.


And that's the whole page, bestie. This iconic manual is from mailsend 1.19, dated 2016-05-17. Periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from