Chinaunix首页 | 论坛 | 博客
  • 博客访问: 283533
  • 博文数量: 70
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 531
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-12 20:22
个人简介

1.01^365=37.8 0.99^365=0.03

文章分类

全部博文(70)

文章存档

2017年(9)

2016年(4)

2015年(14)

2014年(43)

我的朋友

分类: WINDOWS

2017-04-25 12:44:05

Blat 是一个命令行发邮件的小工具,仅支持简单的SMTP协议,需要SMTP服务器的支持。
据说现在新申请的邮箱已经不支持SMTP服务了,是为了抑制垃圾邮件而采取的措施。
但是,Blat也是一个非常方便的小工具,基本上可以满足一般人的需求。


提供下载链接地址:
blat262.full.zip(Blat.exe V2.6.2、Blat.dll V2.6.2、Blat.lib )

blat262.source.zip(Blat V2.6.2 源码)

 

简单使用方法:

在控制台中切换到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

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

附:

Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19)

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

syntax:
Blat -to [optional switches (see below)]
Blat -install [[[]]] [-q]
Blat -profile [-delete | ""] [profile1] [profileN] [-q]
Blat -h

-------------------------------- Installation ---------------------------------
-install[SMTP|NNTP|POP3|IMAP] [
                [ [ [ []]]]]
                : set server, sender, number of tries and port for profile
                  ( and 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 ----------------------------------
      : 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       : text file containing more options (also -optionfile)
-to : recipient list (also -t) (comma separated)
-tf       : recipient list filename
-cc : carbon copy recipient list (also -c) (comma separated)
-cf       : cc recipient list filename
-bcc : blind carbon copy recipient list (also -b)
                  (comma separated)
-bf       : bcc recipient list filename
-maxNames    : send to groups of number of recipients
-ur             : set To: header to Undisclosed Recipients if not using the
                  -to and -cc options
-subject : subject line, surround with quotes to include spaces(also -s)
-ss             : suppress subject line if not defined
-sf       : file containing subject line
-body     : message body, surround with quotes to include spaces
-sig      : text file containing your email signature
-tag      : text file containing taglines, to be randomly chosen
-ps       : final message text, possibly for unsubscribe instructions

----------------------------- Registry overrides ------------------------------
-p     : send with server, user, and port defined in
                : use username and password if defined in
-profile        : list all profiles in the Registry
-server : specify SMTP server to be used (optionally, addr:port)
-serverSMTP
                : same as -server
-serverNNTP
                : specify NNTP server to be used (optionally, addr:port)
-serverPOP3
                : specify POP3 server to be used (optionally, addr:port)
                  when POP3 access is required before sending email
-serverIMAP
                : specify IMAP server to be used (optionally, addr:port)
                  when IMAP access is required before sending email
-f      : override the default sender address (must be known to server)
-i        : a 'From:' address, not necessarily known to the server
-port     : port to be used on the SMTP server, defaults to SMTP (25)
-portSMTP : same as -port
-portNNTP : port to be used on the NNTP server, defaults to NNTP (119)
-portPOP3 : port to be used on the POP3 server, defaults to POP3 (110)
-portIMAP : port to be used on the IMAP server, defaults to IMAP (110)
-u    : username for AUTH LOGIN (use with -pw)
-pw : password for AUTH LOGIN (use with -u)
-pu : username for POP3 LOGIN (use with -ppw)
-ppw : password for POP3 LOGIN (use with -pu)
-iu : username for IMAP LOGIN (use with -ppw)
-ipw : password for IMAP LOGIN (use with -pu)

---------------------- Miscellaneous RFC header switches ----------------------
-organization
                : Organization field (also -o and -org)
-ua             : include User-Agent header line instead of X-Mailer
-x
                : 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    : user defined charset. The default is ISO-8859-1
-a1

    : add custom header line at the end of the regular headers
-a2
    : same as -a1, for a second custom header line
-dsn      : 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 : set message priority 0 for low, 1 for high
-sensitivity    : set message sensitity 0 for personal, 1 for private,
                  2 for company-confidential

----------------------- Attachment and encoding options -----------------------
-attach : attach binary file(s) to message (filenames comma separated)
-attacht : attach text file(s) to message (filenames comma separated)
-attachi : attach text file(s) as INLINE (filenames comma separated)
-embed    : embed file(s) in HTML. Object tag in HTML must specify
                  content-id using cid: tag. eg:
-af       : file containing list of binary file(s) to attach (comma
                  separated)
-atf      : file containing list of text file(s) to attach (comma
                  separated)
-aef      : 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 : plain text for use as alternate text
-alttextf : 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
                : send multipart messages, breaking attachments on
                  KB boundaries, where is per 1000 bytes
-nomps                : do not allow multipart messages

---------------------------- NNTP specific options ----------------------------
-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      : log everything but usage to
-timestamp      : when -log is used, a timestamp is added to each log line
-ti          : set timeout to 'n' seconds. Blat will wait 'n' seconds for
                  server responses
-try : 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 : 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       : wait x seconds between messages being sent when used with
                  -maxnames or -multipart
-comment : 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, 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    The RFC 821 MAIL From: statement
-from        The RFC 822 From: statement
-replyto     The RFC 822 Reply-To: statement
-returnpath The RFC 822 Return-Path: statement
-sender      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.

阅读(3926) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~