Introduction

mailsend is a simple command line program to send mail via SMTP protocol. I used to send a piece of alert mail from a program in a networked Windows machine. You might find it useful in some situations.

Latest Development version is 1.17b14

  mailsend1.17b14.exe   959 KB

Synopsis

Version: @(#) mailsend v1.17b14

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

 (Compiled with OpenSSL version: OpenSSL 1.0.0g  Jan )
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 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
-lilst 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).
  For determining MIME types, please look at MIME Types.

Examples

VERSION

These examples are generated using
 $ mailsend -V
mailsend Version: @(#) mailsend v1.17b11
Compiled with OpenSSL: OpenSSL 0.9.8x May
 

Show server info


$ mailsend -v -info -port  -smtp smtp.gmail.com
$ mailsend -v -info -ssl -port  -smtp smtp.gmail.com
$ mailsend -v -info -smtp smtp.example.com -ct 

STARTTLS + AUTHENTICATION


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

SSL + AUTHENTICATION


 $ mailsend -to user@gmail.com -from user@gmail.com
-ssl -port -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

Attachments


 $ mailsend -f user@example.com -smtp 10.100.30.1
-t user@example.com -sub test -attach "file.txt,text/plain"
-attach "/usr/file.gif,image/gif" -attach "file.jpeg,image/jpg"

 $ mailsend -f user@example.com -smtp 192.168.0.2
-t user@example.com -sub test +cc +bc
-attach "c:\file.gif,image/gif" -M "Sending a GIF file"

 $ mailsend -f user@example.com -smtp 192.168.0.2
-t user@example.com -sub test +cc +bc -cs "ISO-8859-1"
-attach "file2.txt,text/plain"
 

Inline Attachment


 $ mailsend -f user@example.com -d example.com -smtp 10.100.30.1
-t user@example.com -sub test -attach "nf.jpg,image/jpeg,i"
-M "body line1: content disposition is inline"
-M "body line2: this is line2 of the body"
 

mailsend - Send mail via SMTP protocol from command line的更多相关文章

  1. golang:send mail using smtp package

    go语言发送邮件,可以使用smtp包,两个关键函数: func PlainAuth(identity, username, password, host string) Auth func SendM ...

  2. 5 Ways to Send Email From Linux Command Line

    https://tecadmin.net/ways-to-send-email-from-linux-command-line/ We all know the importance of email ...

  3. SSIS Send Mail

    在SSIS中Send Mail的方法主要有三种,使用Send Mail Task,使用Script Task和使用存储过程msdb.dbo.sp_send_dbmail. 一,使用Send Mail ...

  4. 发送邮件的三种方式:Send Mail Message

    发送邮件的三种方式: 1.VBS 执行vbs脚本文件的程序为: system32文件下的 NameSpace = "http://schemas.microsoft.com/cdo/conf ...

  5. SMTP ERROR: Password command failed: 535 Incorrect authentication data

    在处理一个使用PHPMailer来发送电邮,我在本地使用我的163邮箱来做测试发送电邮,能够成功的发送电邮:当上传到正式平台时,出现了,类似这样的错误信息 SMTP ERROR: Password c ...

  6. How to attach multiple files in the Send Mail Task in SSIS

    Let’s say you need to create a SSIS package that creates 2 files and emails the files to someone. Yo ...

  7. 18 Command Line Tools to Monitor Linux Performance

    By Ravi Saive Under: Linux Commands, Monitoring Tools On: December 26, 2013 http://www.tecmint.com/c ...

  8. List of Chromium Command Line Switches(命令行开关集)——官方指定命令行更新网址

    转自:http://peter.sh/experiments/chromium-command-line-switches/ There are lots of command lines which ...

  9. Linux Command Line Basics

    Most of this note comes from the Beginning the Linux Command Line, Second Edition by Sander van Vugt ...

随机推荐

  1. 配有Tesla K40c的服务器新装Ubuntu16.04并安装CUDA8.0、Anaconda3、Matlab2016a、OPENCV3.1、CuDNN5.1、MXNet

    注:本文原创,作者:Noah Zhang  (http://www.cnblogs.com/noahzn/) 决定加入深度学习的大军,感谢导师给配了台新设备!第一次接触服务器并配置开发环境,整个过程中 ...

  2. seajs配合spm应用之四弹出框

    前面描述了 seajs的弹出遮罩层, 还没讲到弹出框, 这里接着把那几个例子介绍完. 目前已经有的工作是, 点击toggle按钮,可以弹出一个背投一样的暗灰色遮罩层, 主要的作用就是遮住当前页面上所有 ...

  3. Servlet处理Cookie

    1.CGI:进程,servlet:线程 2.HttpServletResponse下的方法就没有get开头的,(PrintWriter)getWriter在ServletResponse下. 3.st ...

  4. Cocos2d-x 2.0以上版本安装方法

    1,cd 到2dx根目录,MAC平台使用./create-multi-platform-projects.py  然后提示: -bash: ./create-multi-platform-projec ...

  5. March of the Penguins

    poj3498:http://poj.org/problem?id=3498 题意:某个冰块上有a只企鹅,总共可以跳出去b只,问是否可能所有的企鹅都跳到某一块冰块上,输出所有的可能的冰块的编号. 由于 ...

  6. Android 使用HttpClient方式提交POST请求

    final String username = usernameEditText.getText().toString().trim(); final String password = passwr ...

  7. 一个简单的C#获取Session、设置Session类文件

    一个简单的C#获取Session.设置Session类文件,本类主要实现大家最常用的两个功能: 1.GetSession(string name)根据session名获取session对象: 2.Se ...

  8. Delphi消息的广播方式(先RegisterWindowMessage,后SendMessage HWND_BROADCAST,最后改写接收窗口的WndProc)

    ///////消息广播只能将消息传递到接收消息的主程序中,MDIChild窗体不能接收到广播消息:///////// unit Unit1; interface uses Windows, Messa ...

  9. 【HDOJ】1501 Zipper

    DFS.注意剪枝,0ms. #include <stdio.h> #include <string.h> #define False 0 #define True 1 #def ...

  10. 【POJ】2528 Mayor's posters

    离散化+线段树.数组开的不够大,wa了N多回. #include <iostream> #include <cstdio> #include <cstring> # ...