Blat-windows cmd命令行脚本SMTP模式发邮件的开源工具参数详细说明

blat工具可以在命令行下使用发邮件,所以可能被×××用来盗取计算机文件。
所以(1)不建议安装部署到system32目录,也不要去设置环境变量; 建议自己编写的脚本与blat工具放在同一个目录即可;
(2)此工具会被360等安全软件报毒,所以安装部署前要先受信文件夹;
(3)英文本来源官网,中文版为理解学习对照 不保证翻译的准确性


syntax:

Blat <filename> -to <recipient> [optional switches (see below)]
Blat -install <server addr> <sender‘s addr> [<try>[<port>[<profile>]]] [-q]
Blat -profile [-delete | "<default>"] [profile1] [profileN] [-q]
Blat -h
——看不太懂!看个简单的用法:



Blat -body "test mail" -s "测试test" -t [email protected] -server smtp.qq.com -f [email protected] -u [email protected] -pw lcgcaflcjewvb



——邮件内容:test mail ;邮件主题:测试test ;收件人:[email protected] ;发件人服务器:smtp.qq.com ;发件人:[email protected] ; 账号:[email protected] ; 密码:lcgcaflcjewvb;更多功能在这行命令的基础上去优化完善即可;



blat -h



——查看详细命令参数:

------------Installation (初始化设置) -----------

-install[SMTP|NNTP|POP3] <server addr> <sender‘s 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
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)

——设置服务器地址、发信邮箱、失败尝试次数、端口号、发信邮箱用户名、发信邮箱密码;
——端口号如果不设置,默认:SMTP=25, NNTP=119, POP3=110
——用户名和密码可以存到注册表中。

-------- 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.
——邮件内容文件路径;如果是命令行的内容要 -body开头;
个人觉得使用文件路径比较好。

-of <file> : text file containing more options (also -optionfile)

-to <recipient> : recipient list (also -t) (comma separated)
——收件人名单;逗号分隔;简写"-t"。

-tf <file> : recipient list filename
——收件人名单文件路径。

-cc <recipient> : carbon copy recipient list (also -c) (comma separated)
——抄送人名单;逗号分隔;简写"-c"。

-cf <file> : cc recipient list filename
——抄送人名单文件路径。

-bcc <recipient>: blind carbon copy recipient list (also -b)(comma separated)
——密送人名单;逗号分隔;简"-b"。

-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)
——邮件主题;简写"-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
-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)
——端口号;一般放到server即可;
-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)
-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)

---------- 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

---------------- 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 (NNTP专用参数选项)-------------
-groups <usenet groups>
: list of newsgroups (comma separated)

---------- Other options ------------------
-h : displays this help (also -?, /?, -help or /help)
-q : suppresses all output to the screen
——关闭回显;类似 echo off;

-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.

原文地址:http://blog.51cto.com/mflag/2283256

时间: 2024-10-21 03:22:40

Blat-windows cmd命令行脚本SMTP模式发邮件的开源工具参数详细说明的相关文章

Python实现Windows CMD命令行彩色输出

#! /usr/bin/env python #coding=utf-8 import ctypes,sys STD_INPUT_HANDLE = -10 STD_OUTPUT_HANDLE = -11 STD_ERROR_HANDLE = -12 # 字体颜色定义 ,关键在于颜色编码,由2位十六进制组成,分别取0~f,前一位指的是背景色,后一位指的是字体色 #由于该函数的限制,应该是只有这16种,可以前景色与背景色组合.也可以几种颜色通过或运算组合,组合后还是在这16种颜色中 # Window

Python实现Windows CMD命令行彩色输出(由网友提供)

# -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' import ctypes,sys STD_INPUT_HANDLE=-10 STD_OUTPUT_HANDLE=-11 STD_ERRIR_HANDLE=-12 #定义字体颜色,由于颜色编码,是由2位十六进制组成,分别娶0~f,前一位是指背景色,后一位是字体色 #因为由于函数限制,只有16种颜色,可以进行把前和后景色组合,也可以把其他颜色混合 # Windows 

windows cmd命令行命令

http://blog.csdn.net/pipisorry/article/details/46124995 将下面的命令保存在filename.bat文件中直接点击就可以在windows下直接运行了 合并文件 C:\Users\Administrator\Desktop dir copy *.txt all.txt #pause 取某个文件夹下所有文件的文件名 @echo off dir C:\Users\Administrator\Desktop\ccf\photo *.* > 文件名.t

python 控制 cmd 命令行颜色

基于win7 + python3.4 import ctypes import sys '''Windows CMD命令行颜色''' # 句柄号 STD_INPUT_HANDLE = -10 STD_OUTPUT_HANDLE= -11 STD_ERROR_HANDLE = -12 # 前景色 FOREGROUND_BLACK = 0x0 # 黑 FOREGROUND_BLUE = 0x01 # 蓝 FOREGROUND_GREEN = 0x02 # 绿 FOREGROUND_RED = 0x0

Windows 如何在cmd命令行中查看、修改、删除与添加环境变量

转自:http://www.cnblogs.com/saptechnique/archive/2013/02/17/2914222.html 首先明确一点: 所有的在cmd命令行下对环境变量的修改只对当前窗口有效,不是永久性的修改.也就是说当关闭此cmd命令行窗口后,将不再起作用.永久性修改环境变量的方法有两种:一种是直接修改注册表(此种方法目前没试验过),另一种是通过我的电脑-〉属性-〉高级,来设置系统的环境变量(查看详细). 其次,明确一下环境变量的作用. 它是操作系统用来指定运行环境的一些

Windows下的cmd命令行中设置环境编码

我们都知道,Windows下的cmd命令行默认编码是Windows系统的编码,就是ANSI编码或者说是GBK编码的,这样我们编写的很多应用比如php编写utf-8编码的应用在命令行下面运行时都会出现乱码的情况,原因就是因为运行环境的编码使用自己的编码去解析程序运行结果,而程序本身返回编码和解析编码不一致,最后导致乱码情况的发生. 遇到这种情况,我们可以通过设置cmd命令行环境的编码使编码保持统一来解决,方法如下: 在命令行中,有个命令是chcp,这个命令是用来显示当前活动代码页编号的,也可以理解

在windows中,如何使用cmd命令行窗口正确显示编码为utf-8格式的文字

在windows中,如何使用cmd命令行窗口正确显示编码为utf-8格式的文字呢? 正确的步骤如下: 1, 打开cmd命令行窗口 2, 输入命令 >chcp 65001 数字65001代表的是cmd窗口中utf-8格式的编码.cmd窗口默认编码为gbk,数字代码为936 D:\>chcp 65001 Active code page: 65001 3,在cmd窗口标题栏里右键点击,调出右键菜单,点击属性->字体,将字体改成Lucida Console, OK,可以正确显示utf-8编码的

java学习总结(16.05.08)在windows下使用cmd命令行对java文件进行编译和执行

windows下利用cmd命令行可以调用jdk里的javac.exe和java.exe对java文件进行编译和执行,前提是jdk已成功安装并正确配置相关环境变量(jdk安装与环境变量的配置方法:http://blog.csdn.net/qq_32099621/article/details/51339868) 下面来说一下windows下如何使用cmd命令行来编译执行java文件 首先找到需要编译和执行的java文件 这里我要编译和执行这个java文件 按组合键win+r调出"运行",

cmd命令行安装,删除Windows证书(certgmr的简单使用)

在管理证书的时候需要用到certmgr工具. 在cmd中执行certmgr会弹出证书管理的工具,但是不能用命令行去管理证书,需要额外的工具 cermgr.exe:下载链接 https://pan.baidu.com/s/1wnA-i0ixhSftPsMxv8OQ-Q 在certmgr文件目录下执行certmr.exe ****即可 例:删除指定证书: CertMgr.Exe -del -c -n 证书名 -s my 添加指定证书: CertMgr.Exe -add -all 证书名 -s my