mailsend is a simple command line program to send mail via SMTP protocol. I needed to send a piece of alert mail from a program in a networked Windows machine, but could not find a simple program like this installed. So I wrote one. You might find it useful in some situations. The program does not use any config file and I plan to keep it that way.
From version 1.17b1+, IPv6 is supported in all platforms.
Suggestions, bug reports are always welcome.
If you have any question, request or suggestion, please enter it in the Issues with appropriate label.
To download source/binaries, please go to the releases page.
So many versions! which version to use? I recommend use v1.17b14 in a production environment. If possible, please test v1.17b15 and give your freedback
Using git:
git clone https://github.com/muquit/mailsend.git
To download development branch:
git clone -b develop https://github.com/muquit/mailsend.git mailsend_dev
Development branch will be merged with the main branch every now and then when I think that the dev code is solid.
- Microsoft Windows
- Linux/Unix
- Mac OS X
Released on Mar-4-2012. Please look at: ChangeLog. This version lacks lot of features. Use v1.17b14.
Released on May-25-2014. This version has lot of new features and ready for testing. ChangeLog
Released on Oct-20-2013. Please look at: ChangeLog.
Just because it a development version, it does not mean it is unstable. This version has many bug fixes which is not available in v1.16.
Version: @(#) mailsend v1.16
Copyright: GNU GPL. It is illegal to use this software for Spamming
(Compiled with OpenSSL 1.0.0g 18 Jan 2012) usage: mailsend [options] Where the options are: -smtp hostname/IP* - Hostname/IP address of the SMTP server -port SMTP port - SMTP port -d 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 -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 -l file - a file containing the email addresses -attach file,mime_type,[i/a] (i=inline,a=attachment) - attach this file as attachment or inline -cs character set - for text/plain attachments (default is us-ascii) -M "one line msg" - attach this one line text message -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 -ssl - SMTP over SSL -starttls - Check for STARTTLS and if server supports, do 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 the specified You must know the FQDN or IP address of the SMTP server you use. The file you specify with -l contains email address one per line. For determining MIME types, please look at [mimetypes].
Version: @(#) mailsend v1.17b15
Copyright: BSD. It is illegal to use this software for Spamming
(Compiled with OpenSSL version: 1.0.1g 7 Apr 2014) 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 -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 - sepatorator 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 -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 Environment variables: SMTP_USER_PASS for plain text password (-pass)
Version: @(#) mailsend v1.17b14
Copyright: BSD. It is illegal to use this software for Spamming
(Compiled with OpenSSL version: OpenSSL 1.0.0g 18 Jan 2012) usage: mailsend [options] Where the options are: -copyright - show copyright information -smtp hostname/IP* - Hostname/IP address of the SMTP server -port SMTP port - SMTP port -d 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 -bc bcc,bcc.. - Blind carbon copy address/es +bc - do not ask for Blind carbon copy +D - don 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 -attach file,mime_type,[i/a] (i=inline,a=attachment) - attach this file as attachment or inline -cs character set - for text/plain attachments (default is us-ascii) -enc type - Encoding Type. Only valid type: base64 -H "header" - Add custom Header -M "one line msg" - attach this one line text message -name "Full Name" - add name in the From header -v - verbose mode -show_attach - show attachment in verbose mode, default is no -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 -ssl - SMTP over SSL -starttls - Check for STARTTLS and if server supports, do 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. Environment variables: SMTP_USER_PASS for plain text password (-pass)
$ /bin/sh ./configure --with-openssl=/usr
In Mac OS X Mavericks as of Oct-27-2013, you have to do the following:
$ /bin/sh ./configure --with-openssl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr
Default installation location is /usr/local. If you want to change that:
$ /bin/ch ./configure --with-openssl=/usr --prefix=/usr/local/mailsend $ make clean $ make # make install Or $ sudo make install Or $ make install DESTDIR=/foo
The name of the binary will be mailsend. If compiled with OpenSSL, the support for STARTTLS and SMTP over SSL will be available.
A Debian package is also supplied. To install the package, type:
$ sudo dpkg -i mailsend_1.17b14-ubuntu_i386.deb
To uninstall, type:
$ sudo dpkg -r mailsend
If you prefer to build the Debian package yourself, after compiling, type:
$ ruby ./mk_debian_package.rb
A compiled binary for MS Windows is already supplied. However, if you need to modify something or want to compile it yourself, you will need MS Visual Studio (I used MS Visual Studio 10, freely available from Microsoft). You have to find and run the vsvars32.bat file that came with Visual Studio first in order to use VS from command line. To compile, open a command shell and type:
c:\> nmake -f Makefile.nmake clean c:\> nmake -f Makefile.nmake
It compiles cleanly with cygwin as well. The name of the binary will be mailsend.exe
- For text or html attachments, \r\n is not added at the end of lines. Some SMTP servers (e.g. qmail) does not like that. It will be fixed in some future release.
- For non ascii characters, MIME headers are not converted as per RFC2047
- In Windows, non ascii characters can not be entered with -M from command line (Works fine in Linux and Mac). mailsend uses standard C string functions and Windows versions do not know about multibyte input from command line (Issue #14). If anyone is familiar with it, you are welcome to implement the support, unfortunately I do not have time at this time.
Please look at mailsend FAQ
Plese type: mailsend -example
or look at examples
To display license, please type: mailsend -copyright
Copyright (C) 2001-2014 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.