Home

Blat User Manual

image

Contents

1. Syntax Blat lt filename gt to lt recipient gt optional switches see below Blat install lt server addr gt lt sender s addr gt lt try gt lt port gt lt profile gt q Blat profile delete lt default gt profilel profileN q Blat h install SMTP NNTP POP3 lt server addr gt lt sender s email addr gt lt try n times gt lt port gt lt profile gt lt username gt lt password gt set server sender number of tries and port for profile lt try n times gt and lt port gt 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 instalINNTP for storing NNTP information use installPOP3 for storing POP3 information sender and try are ignored use in place of these blat exe install lt your mailserver com gt lt you yourdomain com gt substituting your mailserver com and you yourdomain com with the name of your SMTP email server and your email address respectively Page 1 of 11 Revised December 1 2007 Blat User Manual Compiled By Mark E Donaldson Installing it this way saves these values in your registry so you don t have to pass them as parameters every time you run Blat Basics lt filename gt file with the message body to be sent if your message body is on the command line use a hyphen as y
2. T 4 T 3 T 2 T 1 T 0 sub GetBodyFromFile my file shift local set the input record separator to nothing open INFO file or die Cannot open file open it Sbody lt INFO gt slurp it into S body Telent To Smtp Server Command What we are doing telnet mail blat tld 25 telnet to a machine that responds to smtp on port 25 HELO blat tld issue the HELO command to start mail from tim blat tld issue the mail from command rept to tim blat tld issue the rcpt to command this should be a valid address data now the data command will allow you to do the rest Page 8 of 11 Revised December 1 2007 Blat User Manual Compiled By Mark E Donaldson typed the stuff in blue Subject The text you want on the subject line on the first line for a subject other headers and the message body follow end the mail message with a on a line by itsel B gt telnet blat tld 25 220 miniRelay Server v0 9 75 ready HELO blat tid 250 Hello blat tld mail from tim blat tld 250 tim blat tld Address Okay rcpt to tim blat tid 250 tim blat tld Address Okay data 354 Start mail input end with lt CRLF gt lt CRLF gt subject The text you want on the subject line This is the message body 250 Ok quit 221 Signing Off How and Why to Run Blat install Blat does not need to be installed All the Blat install command does is store various parameters in the Windows Regestry install lt server
3. E Donaldson profile list all profiles in the Registry server lt addr gt specify SMTP server to be used optionally addr port serverSMTP lt addr gt same as server serverNNTP lt addr gt specify NNTP server to be used optionally addr port serverPOP3 lt addr gt specify POP3 server to be used optionally addr port when POP3 access is required before sending email f lt sender gt override the default sender address must be known to server i lt addr gt a From address not necessarily known to the server port lt port gt port to be used on the SMTP server defaults to SMTP 25 portSMTP lt port gt same as port portNNTP lt port gt port to be used on the NNTP server defaults to NNTP 119 portPOP3 lt port gt port to be used on the POPS server defaults to POPS 110 u lt username gt username for AUTH LOGIN use with pw pw lt password gt password for AUTH LOGIN use with u pu lt username gt username for POP3 LOGIN use with ppw ppw lt password gt password for POP3 LOGIN use with pu Miscellaneous RFC header Switches organization lt organization gt Organization field also o and org ua include User Agent header line instead of X Mailer x lt X Header detail gt 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
4. by gensock is not supported by this Network not ready break Can t resolve mailserver hostname break Can t create a socket too many simultaneous links break Error reading socket break Not a socket break Busy break Error closing socket break Wait a bit possible timeout break Can t resolve service break Can t connect to mailserver timed out if winsock dll error 10060 break Connection to mailserver was dropped break Mail server refused connection break default printf error d in function s retval function Page 11 of 11 Revised December 1 2007
5. command line goes here IF ERRORLEVEL 13 THEN GOTO ERROR13 IF ERRORLEVEL 12 THEN GOTO ERROR12 IF ERRORLEVEL 5 THEN GOTO ERROR5 IF ERRORLEVEL 4 THEN GOTO ERROR4 IF ERRORLEVEL 3 THEN GOTO ERROR3 IF ERRORLEVEL 2 THEN GOTO ERROR2 IF ERRORLEVEL 1 THEN GOTO ERROR1 If we get this far then there was no error code GOTO NOERROR Page 6 of 11 Revised December 1 2007 ERROR13 ECHO ERROR GOTO EXIT ERROR12 ECHO ERROR GOTO EXIT ERRORS ECHO ERROR GOTO EXIT ERROR4 ECHO ERROR GOTO EXIT ERROR3 ECHO ERROR GOTO EXIT ERROR2 ECHO ERROR GOTO EXIT ERROR1 ECHO ERROR GOTO EXIT NOERROR Blat User Manual Compiled By Mark E Donaldson Error opening temporary file in temp directory server or f options not specified or not found in registry Error reading file message text Problem with the file message text Error reading file message text or attached file Error Level 2 returned Error Level 1 returned Any additional batch processing goes here GOTO EXITNOPAUSE EXIT PAUSE EXITNOPAUSE End of batch file here EXAMPLE Blat run from Perl perl use strict use warnings my Debug 0 SMTP go build the Date Time Stamp my DTS DTS SSMTP localhost 0 gets NO console output subject body the SMTP mail server name or IP address Ssubject Testing blat S DTS my sEnvelope tim blat tld tim blat
6. file 4 File message text not of type FILE_TYPE_DISK 5 Error Reading File message text Le es eC H2 Fserver or f options not specified and not found in registry 13 Error opening temporary file in temp directory Codes from ld gensock h 1 8 1995 01 25 23 28 11 rushing Exp 008 ERR ERR SYS NOT READY lt CS XTC 00 RR_READNG SOCKET o ooo Page 10 of 11 Revised December 1 2007 Blat User Manual Compiled By Mark E Donaldson 4014 ERR_CANT RESOLVE SERVICE 4015 ERR_CANT_CONNECT 4016 ERR NOT CONNECTED 4017 ERR_CONNECTION REFUSED 5000 ERR_NO_ERROR_CODE his is returned by misbehaving stacks that fail but don t set an error code Gensock Error Code Descriptions case 4001 printf Error case 4002 printf Error case 4003 printf Error case 4004 printf Error case 4005 printf Error winsock dll break case 4006 printf Error case 4007 printf Error case 4008 printf Error case 4009 printf Error case 4010 printf Error case 4011 printf Error case 4012 printf Error case 4013 printf Error case 4014 printf Error case 4015 printf Error case 4016 printf Error case 4017 printf Error Malloc failed possibly out of memory break Error sending data break Error initializing gensock dll break Version not supported break The winsock version specified
7. tld gt to gt Page 7 of 11 Envelope bits FROM TO Revised December 1 2007 Blat User Manual Compiled By Mark E Donaldson Jo my Data Data bits you can add other parms here as needed subject gt subject just what it sounds like server gt SSMTP specify the SMTP server to use debug gt run Blat with debuging output log gt 0 log dump screen output to a file instead GetBodyFromFile 0 go get the message body from a file put D path filename txt in place of 0 to use your own file Sbody You can also set the body Variable directly if you don t want to get the message body from a file SendIt body Envelope Data sub SendIt my BlatCmd Blat exe the Blat binary path if needed my Sbody shift get the msg body S BlatCmd _ add all the parms now we have something like blat exe f tim blat tld to tim blat tdl debug log C mail tims blat pl log server localhost subject Testing blat 2003 8 20 12 46 6 print n nCommand Line BlatCmd n nMessage Body body n if Debug open MAIL BlatCmd die start Blat with all it s parms print MAIL body now put in the msg body bigger this way than CL sub DTS build the Date Time Stamp Sec T 0 M 1 H 2 mDay 3 Mon 4 Yr 5 wDay 6 yDay 7 isDST 8 my T localtime T 4 T 5 1900 DTS qq T 5
8. used with maxnames or multipart comment lt char gt use this character to mark the start of commments in superdebugT ascii dump the data between Blat and the server options files and recipient list files The default is superdebug Note that if the i option is used lt sender gt 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 lt addr gt The RFC 821 MAIL From statement from lt addr gt The RFC 822 From statement replyto lt addr gt The RFC 822 Reply To statement returnpath lt addr gt The RFC 822 Return Path statement sender lt addr gt The RFC 822 Sender statement For backward consistency the f and i options have precedence over these RFC 822 defined options lf 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 EXAMPLE Blat run from a Batch file echo off siirron rir Lets set some variables 22 2222322 set eMail tim blat tld Page 5 of 11 Revised December 1 2007 Blat User Manual Compiled By Mark E Donaldson set subj s Test Blat set server server localhost set x x X Header Test Can Blat do it Yes it Can set debug debug log blat log timestamp piri ii iiit Now we run Blat AE E es ee ae es blat 0 to eMail f eMail subj tserver tdebug x The above resolves t
9. Blat User Manual Compiled By Mark E Donaldson Description Blat is a Public Domain Win32 console utility that sends the contents of a file in an e mail message using the SMTP protocol Blat is useful for creating scripts where mail has to be sent automatically To use Blat you must have access to a SMTP server via TCP IP Blat can store various default settings in the registry The command line options override the registry settings Input from the console STDIN can be used instead of a disk file if the special filename is specified Blat can also carbon copy and blind carbon copy the message Impersonation can be done with the i flag which puts the value specified in the From line however when this is done the real senders address is stamped in the Reply To and Sender lines This feature can be useful when using the program to send messages from users that are not registered on the SMTP host Optionally Blat can also attach multiple files to your message Installation If you are upgrading from version 1 2 or later simply copy Blat exe over the old one Blat no longer needs gensock dll or gwinsock dll You can delete these unless another application you use requires them If you are upgrading from Blat 1 1 or 1 0 or you never used Blat before you can copy the file Blat exe to your WINNT SYSTEM82 directory or to any other directory in your path or optionaly run Blat install smtp yoursite tld youruserid yoursite tld
10. addr gt lt sender s addr gt lt try n times gt lt port gt lt profile gt lt username gt lt password gt Syntax le the characters indicate optional parameters However you may not skip any his is the from address usually like tim blat tld etryntimes gt How many times to try to send the message defaults to 0 l lt profile gt allows Blat to track multiple sets of settings use p to reference lt password gt l al Tell Blat to be quite when storing install settings in the registry may be replaced by to set default and allow following options port defaults are SMTP 25 NNTP 119 order of options is specific use instalINNTP for storing NNTP information Page 9 of 11 Revised December 1 2007 Blat User Manual Compiled By Mark E Donaldson blat install localhost tim blat tid 3 26 amp TCP IP Port to send the mail using 26 eae localhost tim blat tid 3 26 amp store the settings in a Profiles named FromTim1 ae ees Gace TMG Rene use the default number of tries and Port Blat Return Codes sod L ___Peseriptien E a a The mail server doesn t like the sender name Unable to open SMTP socket SMTP get line did not return 220 command unable to write to socket Server does not like To address Mail server error accepting message data OOK H File name message text not given 2 File message text does not exist 8 Error reading the file message text or attached
11. message body is in 16 or 32 bit Unicode format html send an HTML message Content Type text html alttext lt text gt plain text for use as alternate text alttextf lt file gt 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 lt size gt send multipart messages breaking attachments on lt size gt KB boundaries where lt size gt is per 1000 bytes nomps do not allow multipart messages Page 4 of 11 Revised December 1 2007 Blat User Manual Compiled By Mark E Donaldson NNTP Specific Options groups lt usenet groups gt list of newsgroups comma separated Other Options 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 lt file gt log everything but usage to lt file gt timestamp when log is used a timestamp is added to each log line ti lt n gt set timeout to n seconds Blat will wait n seconds for lt n times gt how many times blat should try to send 1 to INFINITE try y do not convert ASCII pipe 0x7c to CrLf in the message body hostname lt hst gt select the hostname used to send the message via SMTP raw lt x gt hex ascii dump the data between Blat and the server delay wait x seconds between messages being sent when
12. o Blat batch bat to tim blat tld f tim blat tld s Test Blat server localhost debug log blat log timestamp x X Header Test Can Blat do it Yes it Can EXAMPLE Checking ErrorLevels Returned From Blat Qecho off nee iceressase Lets set some variables 23 27 32f 2 set email tim blat tld set server server localhost set subject s Test Blat ERRORLEVEL s set tof to temail f email pyhh pide eeese ot ss Now we run Blat Pare SA tee oe as blat tmsg tof tsubject tserver ihre igicis A quick message to the screen i2icogriirii echo ErrorLevel returned from Blat SERRORLEVEL Check each errorlevel from 0 through 14 in that order set ELmsg Blat returned this ERRORLEVEL PERRET fh Here as the FOR oop lt 2 nhis hres FOR L i IN 0 1 14 DO if ERRORLEVEL i echo ELmsg i Here s an example of how you could capture the return codes from Blat Important things to note is that error level checking is done beginning with the highest number then going down to the lowest number A zero means no error Any additional commands to be executed if Blat runs successfully should follow the NOERROR label If an error does occur the batch file will display an error message and then stop waiting for the operator to press a key for it to then continue If Blat runs with no errors error level zero then the batch file exits without any messages and without stopping Sample batch file for Blat ECHO OFF blat rest of
13. our 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 lt file gt text file containing more options also optionfile to lt recipient gt recipient list also t comma separated tf lt file gt recipient list filename cC lt recipient gt carbon copy recipient list also c comma separated cf lt file gt cc recipient list filename bcc lt recipient gt blind carbon copy recipient list also b comma separated bf lt file gt bcc recipient list filename maxNames lt x gt send to groups of lt x gt number of recipients ur set To header to Undisclosed Recipients if not using the to and cc options subject lt subj gt subject line surround with quotes to include spaces also s SS Suppress subject line if not defined Sf lt file gt file containing subject line body lt text gt message body surround with quotes to include spaces sig lt file gt text file containing your email signature tag lt file gt text file containing taglines to be randomly chosen ps lt file gt final message text possibly for unsubscribe instructions Registry Overrides p lt profile gt send with server user and port defined in lt profile gt use username and password if defined in lt profile gt Page 2 of 11 Revised December 1 2007 Blat User Manual Compiled By Mark
14. r request return receipt charset lt cs gt user defined charset The default is ISO 8859 1 Page 3 of 11 Revised December 1 2007 Blat User Manual Compiled By Mark E Donaldson a1 lt header gt add custom header line at the end of the regular headers a2 lt header gt same as a1 for a second custom header line dsn lt nsfd gt 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 lt pr gt set message priority O for low 1 for high Attachment and Encoding Options attach lt file gt attach binary file s to message filenames comma separated attacht lt file gt attach text file s to message filenames comma separated attachi lt file gt attach text file s as INLINE filenames comma separated embed lt file gt embed file s in HTML Object tag in HTML must specify content id using cid tag eg lt img src cid image jpg gt af lt file gt file containing list of binary file s to attach comma separated atf lt file gt file containing list of text file s to attach comma separated aef lt file gt file containing list of embed file s to attach comma separated enrich base64 send binary files using base64 binary MIME uuencodeed send binary files UUEncoded unicode

Download Pdf Manuals

image

Related Search

Related Contents

本アップデートに伴い、改変されたマニュアル - StreamAuthor  User Manual - goactechnologies.com  StudyGuide Adv electronics  ayout 1 - ican.gr  AVISO Bee Bedienungsanleitung - ghe  Abridged user`s manual    division 333 - Ministère de l`écologie, du développement durable et    RE60FW 取扱説明書  

Copyright © All rights reserved.
Failed to retrieve file