Windows下コマンドライン送信メールblat.exe


部门のボスがSVNの自动的にメールを送るため、しかしサーバーがwindowsなため、メールのクライアントは多いですが、しかしコマンドラインのクライアントに基づいてまだ少なくて、后ろのボスはblat.exeというソフトウェアを探し当てて、彼が何度も试みて失败したため、私にテストさせて、テストを経て、とても简単で、机能はとても强大で、とても良いオープンソースツールです!
BLAT公式サイト:http://www.blat.net/
採用バージョン:blat 3217(64ビットプログラム)
基本手順:
(1)ソフトウェアをダウンロードし、環境変数を設定すると、環境変数を設定するメリットがたくさんあります.ディレクトリの問題にこだわる必要はありません.
(2)コマンドラインblat
 
 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  -to  [optional switches (see below)]
  Blat -SaveSettings -f  -server 
       [-port ] [-try ] [-profile ]
       [-u ] [-pw ]
  or
  Blat -install   [[[]]] [-q]
  Blat -profile [-delete | ""] [profile1] [profileN] [-q]
  Blat -h

基本は2ステップ、1ステップ目は1つの簡単な登録、2部目はメールを送信することができます
 
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 Gb2312Blat v3.2.17 (build : Aug 10 2016 22:32:51)64-bit Windows, Full, Unicode
Sending c:\www.txt to 18***@163.comSubject: Contents of file: www.txtLogin name is ****@wi****.comTry number 1 of 3.
 
以下の部分は使っていませんが、いい感じなので集めました.
http://jfxwc.blog.163.com/blog/static/650205020105544357851/
バッチコマンド例:----------------------------------------------------------------------@echo off::::::::::::パラメータ設定::::::::::::::::::::::::set [email protected] user=xxxset pass=xxxset [email protected]=テストset mail=mail_body.txtxtsetserver=smtp.163.comset attach=attach.rarset debug=-debug-log blat.log-timesamp::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::tach%%debug%---------------------------------------------------------------------------------------------------テストの結果、中国語の内容に問題はなく(ソースファイルの符号化に注意)、163などのシステムをサポートし、mail_body.txt:本文attach.rar:添付ファイル