Blat - A Windows (32 & 64 bit) command line SMTP mailer. Use it to automatically eMail logs, the contents of a html FORM, or whatever else you need to send。 没错,这个就是这个开源小工具的开发者(blatman, mussont)在sourceforge.net发布的时候的描述。

下载链接(包括了可执行文件和源代码):

  官网:http://www.blat.net

  Sourceforge: http://sourceforge.net/projects/blat/?source=navbar

简单使用方法:

在控制台中切换到Blat.exe V2.6.2文件所在地址(仅需Blat.exe文件);

配置Blat的SMTP服务器:
blat -install sever usr try port [profile]
163邮箱举例:
blat -install smtp.163.com user@163.com 3 25
其中的smtp.163.com是163的smtp服务器地址;user@163.com是自己的邮箱名,3是指尝试发送的次数,25是端口号;
[profile]指的是这个配置文件的名称,可以不填,也可以自己用一个名字,等到发送邮件的时候,就可以使用-p选项来指定配置,如果同时使用多个邮箱的话,这个就很方便了。

发送邮件:
blat C:/mail.txt -to demo@demo.com -attach "C:/fujia.txt" -s "zhuti" -u user@163.com -pw password -charset Gb2312
其中的mail是写好的邮件文件(邮件正文,已文件方式保存),-to demo@demo.com是收件人的地址,-attach "C:/fujia.txt"是附件地址,-s "zhuti"主题,-u user@163.com登陆服务器的用户名,-pw password密码, -charset Gb2312是中文编码

显示信息:
Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19)
Sending C:/mail.txt to demo@demo.com
Subject: zhuti
Login name is user@163.com
Attached binary file: C:/fujia.txt

如果只是以上信息,而没有错误提示,那么邮件就发送成功了。

下面列出了常用的帮助说明,在批处理中使用的时候,如需要查看帮助,可使用:/help或/?

-------------------------------- Installation ---------------------------------
-install[SMTP|NNTP|POP3|IMAP] <server addr> <sender email addr> [<try n times>
[<port> [<profile> [<username> [<password>]]]]]
: set server, sender, number of tries and port for profile
(<try n times> and <port> may be replaced by '-')
port defaults are SMTP=25, NNTP=119, POP3=110, IMAP=143
default profile can be specified with a '-'
username and/or password may be stored to the registry
order of options is specific
use -installNNTP for storing NNTP information
use -installPOP3 for storing POP3 information
(sender and try are ignored, use '-' in place of these)
use -installIMAP for storing IMAP information
(sender and try are ignored, use '-' in place of these) --------------------------------- The Basics ----------------------------------
<filename> : file with the message body to be sent
if your message body is on the command line, use a hyphen (-)
as your first argument, and -body followed by your message
if your message will come from the console/keyboard, use the
hyphen as your first argument, but do not use -body option.
-of <file> : text file containing more options (also -optionfile)
-to <recipient> : recipient list (also -t) (comma separated)
-tf <file> : recipient list filename
-cc <recipient> : carbon copy recipient list (also -c) (comma separated)
-cf <file> : cc recipient list filename
-bcc <recipient>: blind carbon copy recipient list (also -b)
(comma separated)
-bf <file> : bcc recipient list filename
-maxNames <x> : send to groups of <x> number of recipients
-ur : set To: header to Undisclosed Recipients if not using the
-to and -cc options
-subject <subj> : subject line, surround with quotes to include spaces(also -s)
-ss : suppress subject line if not defined
-sf <file> : file containing subject line
-body <text> : message body, surround with quotes to include spaces
-sig <file> : text file containing your email signature
-tag <file> : text file containing taglines, to be randomly chosen
-ps <file> : final message text, possibly for unsubscribe instructions ----------------------------- Registry overrides ------------------------------
-p <profile> : send with server, user, and port defined in <profile>
: use username and password if defined in <profile>
-profile : list all profiles in the Registry
-server <addr> : specify SMTP server to be used (optionally, addr:port)
-serverSMTP <addr>
: same as -server
-serverNNTP <addr>
: specify NNTP server to be used (optionally, addr:port)
-serverPOP3 <addr>
: specify POP3 server to be used (optionally, addr:port)
when POP3 access is required before sending email
-serverIMAP <addr>
: specify IMAP server to be used (optionally, addr:port)
when IMAP access is required before sending email
-f <sender> : override the default sender address (must be known to server)
-i <addr> : a 'From:' address, not necessarily known to the server
-port <port> : port to be used on the SMTP server, defaults to SMTP (25)
-portSMTP <port>: same as -port
-portNNTP <port>: port to be used on the NNTP server, defaults to NNTP (119)
-portPOP3 <port>: port to be used on the POP3 server, defaults to POP3 (110)
-portIMAP <port>: port to be used on the IMAP server, defaults to IMAP (110)
-u <username> : username for AUTH LOGIN (use with -pw)
-pw <password> : password for AUTH LOGIN (use with -u)
-pu <username> : username for POP3 LOGIN (use with -ppw)
-ppw <password> : password for POP3 LOGIN (use with -pu)
-iu <username> : username for IMAP LOGIN (use with -ppw)
-ipw <password> : password for IMAP LOGIN (use with -pu) ---------------------- Miscellaneous RFC header switches ----------------------
-organization <organization>
: Organization field (also -o and -org)
-ua : include User-Agent header line instead of X-Mailer
-x <X-Header: detail>
: custom 'X-' header. eg: -x "X-INFO: Blat is Great!"
-noh : prevent X-Mailer/User-Agent header from showing Blat homepage
-noh2 : prevent X-Mailer header entirely
-d : request disposition notification
-r : request return receipt
-charset <cs> : user defined charset. The default is ISO-8859-1
-a1 <header> : add custom header line at the end of the regular headers
-a2 <header> : same as -a1, for a second custom header line
-dsn <nsfd> : use Delivery Status Notifications (RFC 3461)
n = never, s = successful, f = failure, d = delayed
can be used together, however N takes precedence
-hdrencb : use base64 for encoding headers, if necessary
-hdrencq : use quoted-printable for encoding headers, if necessary
-priority <pr> : set message priority 0 for low, 1 for high
-sensitivity <s> : set message sensitity 0 for personal, 1 for private,
2 for company-confidential ----------------------- Attachment and encoding options -----------------------
-attach <file> : attach binary file(s) to message (filenames comma separated)
-attacht <file> : attach text file(s) to message (filenames comma separated)
-attachi <file> : attach text file(s) as INLINE (filenames comma separated)
-embed <file> : embed file(s) in HTML. Object tag in HTML must specify
content-id using cid: tag. eg: <img src="cid:image.jpg">
-af <file> : file containing list of binary file(s) to attach (comma
separated)
-atf <file> : file containing list of text file(s) to attach (comma
separated)
-aef <file> : file containing list of embed file(s) to attach (comma
separated)
-base64 : send binary files using base64 (binary MIME)
-uuencode : send binary files UUEncoded
-enriched : send an enriched text message (Content-Type=text/enriched)
-unicode : message body is in 16- or 32-bit Unicode format
-html : send an HTML message (Content-Type=text/html)
-alttext <text> : plain text for use as alternate text
-alttextf <file>: plain text file for use as alternate text
-mime : MIME Quoted-Printable Content-Transfer-Encoding
-8bitmime : ask for 8bit data support when sending MIME
-multipart <size>
: send multipart messages, breaking attachments on <size>
KB boundaries, where <size> is per 1000 bytes
-nomps : do not allow multipart messages ---------------------------- NNTP specific options ----------------------------
-groups <usenet groups>
: list of newsgroups (comma separated) -------------------------------- Other options --------------------------------
-xtndxmit : Attempt to use POP3 to transmit when accessing POP3 first
-h : displays this help (also -?, /?, -help or /help)
-q : suppresses all output to the screen
-debug : echoes server communications to a log file or screen
(overrides -q if echoes to the screen)
-log <file> : log everything but usage to <file>
-timestamp : when -log is used, a timestamp is added to each log line
-ti <n> : set timeout to 'n' seconds. Blat will wait 'n' seconds for
server responses
-try <n times> : how many times blat should try to send (1 to 'INFINITE')
-binary : do not convert ASCII | (pipe, 0x7c) to CrLf in the message
body
-hostname <hst> : select the hostname used to send the message via SMTP
this is typically your local machine name
-raw : do not add CR/LF after headers
-delay <x> : wait x seconds between messages being sent when used with
-maxnames or -multipart
-comment <char> : use this character to mark the start of commments in
options files and recipient list files. The default is ;
-superdebug : hex/ascii dump the data between Blat and the server
-superdebugT : ascii dump the data between Blat and the server
------------------------------------------------------------------------------- Note that if the '-i' option is used, <sender> is included in 'Reply-to:'
and 'Sender:' fields in the header of the message. Optionally, the following options can be used instead of the -f and -i
options: -mailfrom <addr> The RFC 821 MAIL From: statement
-from <addr> The RFC 822 From: statement
-replyto <addr> The RFC 822 Reply-To: statement
-returnpath <addr> The RFC 822 Return-Path: statement
-sender <addr> The RFC 822 Sender: statement For backward consistency, the -f and -i options have precedence over these
RFC 822 defined options. If both -f and -i options are omitted then the
RFC 821 MAIL FROM statement will be defaulted to use the installation-defined
default sender address.

批处理协同blat自动发邮件的更多相关文章

  1. PHP自动发邮件

    自动发邮件 使用了这个类http://bbs.php100.com/read-htm-tid-121431.html 因他用的php版本较老,用到了函数ereg_replace() 和 ereg() ...

  2. python自动发邮件库yagmail

    #### 一般发邮件方法 我以前在通过Python实现自动化邮件功能的时候是这样的: import smtplib from email.mime.text import MIMEText from ...

  3. java windows自动化-mail自动发邮件

    本文旨在让测试人员了解如何发邮件 发邮件的话,最简单的事是直接手动发邮件,但是在自动化测试中,应做到让机器或者代码来自动发送邮件,笔者大概了解以下几种方法,总有一款口味适合你:1java代码来做下面即 ...

  4. jira6.3.6创建问题不自动发邮件通知的问题

    装完jira6.3.6后,设置好邮件服务器,测试没有问题.但是创建问题不自动发邮件提示用户.折腾了大半天,请教了一位大神,终于搞定.步骤是: agile->系统->用户界面->用户缺 ...

  5. redmine创建新闻,自动发邮件给项目组所有成员

    redmine创建新闻,自动发邮件给项目组所有成员: 1.添加用户至公共项目内 2.配置系统邮件推送配置 3.检查用户接受推送配置 3.使用管理员账户发布新闻(不能自己发送自己) 4.查看邮件接受邮件

  6. python自动发邮件库yagmail(转)

    一般发邮件方法 我以前在通过Python实现自动化邮件功能的时候是这样的: import smtplib from email.mime.text import MIMEText from email ...

  7. 【python】python 自动发邮件

    一.一般发邮件的方法 Python对SMTP支持有smtplib和email两个模块,email负责构造邮件,smtplib负责发送邮件. 注意到构造MIMETEXT对象时,第一个参数就是邮件正文,第 ...

  8. Selenium 2自动化测试实战38(整合自动发邮件功能)

    整合自动发邮件功能 解决了前面的问题后,现在就可以将自动发邮件功能集成到自动化测试项目中了.下面重新编辑runtest.py文件 #runtest.py #coding:utf-8 from HTML ...

  9. Selenium 2自动化测试实战37(自动发邮件功能)

    自动发邮件功能 例如,如果想在自动化脚本运行完成之后,邮箱就可以收到最新的测试报告结果.SMTP(Simple Mail Transfer Protocol)是简单邮件传输协议,它是一组用于由源地址到 ...

随机推荐

  1. HTML里面Textarea换行总结

    近期碰到一个数据转来转去转到Textrea里面能否真正按行存放的问题,在这里总结一下:   问题描写叙述: 比方get数据到一个TextArea里面,如“AAA BBB”,想把这段文字在TextAre ...

  2. docker-proxy 实现容器代理访问

    可实现多个容器web主机对外提供访问 运行代理容器 nginx-proxy docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.soc ...

  3. jvisualvm图解

    http://blog.csdn.net/a19881029/article/details/8432368 jvisualvm能干什么:监控内存泄露,跟踪垃圾回收,执行时内存.cpu分析,线程分析. ...

  4. cookie记录浏览记录

    cookie记录浏览记录 HashMap也是我们使用非常多的Collection,它是基于哈希表的 Map 接口的实现,以key-value的形式存在.在HashMap中,key-value总是会当做 ...

  5. expect批量分发公钥

    sshkey.exp #!/usr/bin/expect# 由于是多台服务器,需要在shell脚本中循环调用该脚本 if { $argc != 2 } { send_user "usage: ...

  6. android开发之重写Application类

    在android应用开发中,重写Application也算是比较常见的,以前开发的一些程序太过于简单,都不要重写这个类,但是在真正的商业开发中,重写Application类几乎是必做的. 为什么要重写 ...

  7. Android开发之View重写相关API-onLayout,onMeasure,MeasureSpec

     1.onLayout android.view.ViewGroup protected void onLayout(boolean changed, int l, int t, int r, int ...

  8. ubuntu 14.04/15.10 安装基于eclipse的android app开发环境

    一开始是装了ubuntu15.10,不知道是我的x200机器太old还是iso镜像有问题,总是各种莫名的引导不起来.有时候刚刚装好的干净系统,只install了一个vim和openssh,重启,然后就 ...

  9. CentOS7添加第三方源

    CentOS由于很追求稳定性,所以官方源中自带的软件不多,因而需要一些第三方源,比如EPEL.ATrpms.ELRepo.Nux Dextop.RepoForge等. EPEL EPEL即Extra ...

  10. USB开发——内核USB驱动+libusb开发方法

    linux内核已经具备usb驱动,所以一些设备使用可以免驱,libusb是针对linux内核中ubs驱动的一套api,会自行调用usb驱动接口,并为应用提供api接口,将usb设备开发减少为应用层开发 ...