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. Noah的学习笔记之Python篇:命令行解析

    Noah的学习笔记之Python篇: 1.装饰器 2.函数“可变长参数” 3.命令行解析 注:本文全原创,作者:Noah Zhang  (http://www.cnblogs.com/noahzn/) ...

  2. 手写JS无缝滚动插件

    <!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8&qu ...

  3. ARCH Linux pacman 包管理器出错总结

    最在使用ARCH的时候使用命令: sudo pacman -S Ruby 终端报错: error: could not open file /var/lib/pacman/sync/apricity- ...

  4. 【产品体验】echo回声

    本人产品新人,学习中,希望大家用过该产品的给点意见,不吝赐教哦~~ 先来两张echo的界面图镇楼——        echo简介: “echo”是一款做声音社交的APP,在这里,你可以感受到声音无限的 ...

  5. windows server 2003 服务器

    服务器基本知识:可通过我的电脑属性里面查看服务器的系统. 设置固定Ip:本地连接(控制面板-网络连接)使用下面的Ip地址.通过ipconfig/all,查看DNS和ip. 远程访问服务器:我的电脑属性 ...

  6. bzoj 1040: [ZJOI2008]骑士 環套樹DP

    1040: [ZJOI2008]骑士 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1755  Solved: 690[Submit][Status] ...

  7. 彻底理解ThreadLocal(转)

    ThreadLocal是什么 早在JDK 1.2的版本中就提供java.lang.ThreadLocal,ThreadLocal为解决多线程程序的并发问题提供了一种新的思路.使用这个工具类可以很简洁地 ...

  8. Spring MVC 解读——@RequestMapping (2)(转)

    转自:http://my.oschina.net/HeliosFly/blog/214438 Spring MVC 解读——@RequestMapping 上一篇文章中我们了解了Spring如何处理@ ...

  9. 【HDOJ】1811 Rank of Tetris

    并查集+拓扑排序.使用并查集解决a = b的情况. #include <iostream> #include <cstdio> #include <cstring> ...

  10. 大型系统OA--技术

    OA办公自动化系统--技术 1.由于涉及企业的流程控制与规则管理.所以系统对于规范要求的严谨性,导致在小型开发组在进行开发时必须基于成熟的技术架构.开源的lemon OA,采用了如下技术细节: mys ...