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. FutureTask源码解读

    import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.ut ...

  2. fixSidebar简介与修正log

    fixSidebar是自己写的一个侧边栏固定小组件,主要是用于主内容较长时让侧边栏能保持显示,依赖于jQuery. Github地址 https://github.com/iRuxu/fixSideb ...

  3. 如何打造一款五星级的 APP ?

    移动互联网大潮来袭!据统计,2015 年平均每天有 1000 个新的应用上架,而这些应用的现状可以说是鱼龙混杂,同是每个人的眼光.品味.意识和利益都不同,因此每人眼中的应用也是不同的.在巨大的市场竞争 ...

  4. python中使用kazoo连接zookeeper(一)

    http://hi.baidu.com/eldersun/item/b9266e019da769f0f45ba6a4 python下连接zookeeper使用最多的是python 包装的zookeep ...

  5. 手动更改WIN远程桌面端口,要改两个地方的注册表哟

    看到我的服务器有老多人在用桌面连接,虽然进不去,但他们不停地试,浪费掉不少服务器资源,我看到网上有不少关于修改3389的介绍.修改3389的工具,一些工具一点用都没有,纯属扯淡.修改后照样是3389. ...

  6. Android 使用HTTP(get和post)方式登陆服务器

    package com.wuyou.submittoserver; import android.os.Bundle; import android.support.v7.app.ActionBarA ...

  7. ifstream文件尾最后一行读两次

    看下面一段代码:       ifstream m_fileConfig;     string str;     m_fileConfig.open(FILE_OPERATORS, ios::out ...

  8. 【Better Code】面向切面编程

    用AOP改善JavaScript代码http://www.w3cfuns.com/thread-5597323-1-1.html

  9. 【转】使用命令行方式创建和启动android模拟器

    原文网址:http://blog.csdn.net/tiandinilv/article/details/8953001 1.Android模拟器介绍 Android中提供了一个模拟器来模拟ARM核的 ...

  10. HDU 5925 Coconuts 【离散化+BFS】 (2016CCPC东北地区大学生程序设计竞赛)

    Coconuts Time Limit: 9000/4500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Su ...