| 
 | 
	
 
 
 由于部门老大做SVN的自动发送邮件,但是由于服务器是windows,虽然邮件客户端很多,但是基于命令行的客户端还是很少的,后面老大就找到了blat.exe这个软件,由于他多次尝试失败,就让我测试,经过测试,发现非常的简单,功能挺强大,是一款很不错的开源工具!BLAT官网:http://www.blat.net/ 
采用版本:blat3217 (64位程序) 
基本步骤: 
(1)下载软件,并对其设置环境变量,设置环境变量会有很多的好处,我们不必要纠结目录问题; 
(2)命令行blat 
 
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
 |  C:\Users\Administrator>blat 
    Blat v2.7.6 w/GSS encryption (build : Oct 25 2011 21:12:01) 
 
    Win32  console utility to send mail via SMTP or post to usenet via NNTP 
    by P.Mendes,M.Neal,G.Vollant,T.Charron,T.Musson,H.Pesonen,A.Donchey,C.Hyde 
  http://www.blat.net 
syntax: 
  Blat <filename> -to <recipient> [optional switches (see below)] 
  Blat -SaveSettings -f <sender email addy> -server <server addr> 
       [-port <port>] [-try <try>] [-profile <profile>] 
       [-u <login id>] [-pw <password>] 
  or 
  Blat -install <server addr> <sender's addr> [<try>[<port>[<profile>]]] [-q] 
  Blat -profile [-delete | "<default>"] [profile1] [profileN] [-q] 
  Blat -h 
 
 |  
  
 
基本就是两步,第一步一个简单的注册,第二部就可以发送邮件 
 
C:\Users\Administrator>blat  -install smtp.*******.com    ***@wi****.com 3 25 
发送命令: 
C:\Users\Administrator>blat c:\www.txt -to 18**@163.com  -u  **@wi***.com  -pw  *****  -charset Gb2312 
Blat v3.2.17 (build : Aug 10 2016 22:32:51) 
64-bit Windows, Full, Unicode 
Sending c:\www.txt to 18***@163.com 
Subject: Contents of file: www.txt 
Login name is ****@wi****.com 
Try number 1 of 3. 
 
以下部分我们未用到,但是感觉不错所以就收集了, 
http://jfxwc.blog.163.com/blog/static/650205020105544357851/ 
批命令例子: 
----------------- 例子开始 ----------------------------------------- 
@echo off 
:::::::::::::: 参数设置:::::::::::::: 
set from=xxx@163.com 
set user=xxx 
set pass=xxx 
set to=xxx@163.com 
set subj=测试 
set mail=mail_body.txt 
set server=smtp.163.com 
set attach=attach.rar 
set debug=-debug -log blat.log -timestamp 
::::::::::::::::: 运行blat ::::::::::::::::: 
rem blat %mail% -to %to% -base64 -charset Gb2312 -subject %subj% -server %server% -f %from% -u %user% -pw %pass% -attach %attach% %debug% 
----------------- 例子结束 ----------------------------------------- 
 
经过测试,中文内容没有问题(注意源文件的编码),支持 163 之类的系统,  
mail_body.txt : 正文 
attach.rar : 附件 
 
 
 |   
 
 
 
 |