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. [译]36 Days of Web Testing(二)

    Day 7: Http 和 Https Why? 当在网络上传输一些私人,敏感信息时,应该采用加密的手段来保证这些信息在传输的过程中不被侦测到.Https协议正是这种实现机制. Https是一种广泛使 ...

  2. 十大响应式Web设计框架

    http://www.csdn.net/article/2014-05-13/2819739-responsive-frameworks-for-web-design 对于设计师而言,网站设计中的任意 ...

  3. 树莓派连接GPS模块

    一月份的时候觉得好玩买了树莓派,但是太懒没怎么研究,但最近当初买树莓派时的那个梦想又萦绕心头,决定抽空完成一下当年的计划~ GPS模块是其中很重要的一环,于是在某宝上搜索,找了一家相对便宜也很轻巧的G ...

  4. Zoj 3865 Superbot

    按规则移动机器人 , 问是否能拾得宝藏 . 加了一个控制板 , 还增加了一个控制板移动周期 p 将移动周期变换一下 , 移动一次  就相当于光标向左不耗费时间的移动了一格 搜索思路 : 搜索当前格子到 ...

  5. 区分html与css中的属性

    CSS中id与Class的区别 1.在CSS文件里书写时,ID加前缀"#":CLASS用"." 2.id一个页面只可以使用一次:class可以多次引用. 3.I ...

  6. python中并行遍历:zip和map-转

    http://blog.sina.com.cn/s/blog_70e50f090101lat2.html 1.并行遍历:zip和map 内置的zip函数可以让我们使用for循环来并行使用多个序列.在基 ...

  7. WebSocket能干啥

    ------这东西到底有什么用途,仔细看了说明,还是不明所以.楼上几位能不能介绍一下实际使用的场景?? 1.可以实现 服务器端(delphi&lazarus@win)<->手机端  ...

  8. Android listView scroll 恢复滚动位置

    相信大家尝试过许多方法恢复滚动位置,本人也找了许多方法,唯有这个方法好用,下面把代码贴出来 声明两个变量 private int mPosition; private int lvChildTop; ...

  9. 标量子查询优化(用group by 代替distinct)

    标量子查询优化 当使用另外一个SELECT 语句来产生结果中的一列的值的时候,这个查询必须只能返回一行一列的值.这种类型的子查询被称为标量子查询 在某些情况下可以进行优化以减少标量子查询的重复执行,但 ...

  10. Android开源项目整理:个性化空间View篇(看遍论坛千万篇,不看此篇也枉然)

    个性化View控件虽然你在多处可以找到 但是这个整理的不可以不看欧: 主要介绍不错的个性化View,包括ListView.ActionBar.Menu.ViewPager.Gallery.GridVi ...