INDEX

 - description
 - installation
 - what's new in this version
 - usage
 - examples
 - future improvements
 - copyright
 - authors
 - contributors


DESCRIPTION:

Blat is a Public Domain (generous aren't we?) Windows NT 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
(CGI, backups, etc.) To use Blat you must have access to a SMTP server via
TCP-IP. Blat uses the a DLL ("gensock" or "gwinsock") from WinVN, the public
domain usenet newsreader for windows. Blat can store a default SMTP server
address and a default "From:" field in the registry. The server's address can
be overriden using the -server flag, and the "From:" address using the -f
flag. 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 NT
users that are not registered on the SMTP host.


INSTALLATION:

If you are upgrading from version 1.3, 1.4 or 1.5 1.6.3, simply copy Blat.exe
over the old one.

If you are upgrading from version 1.2 then copy the new Blat.exe over the old
one and (optionally) substitue gensock.dll with gwinsock.dll. The new DLL is
used if found on the path, if not Blat tries to load the old one (the new one
is more efficient though).

If you are upgrading from Blat 1.1 or 1.0 (phew!) or you never used Blat before
you must follow these steps:

1) Copy the file "gwinsock.dll" to your "\WINNT\SYSTEM32" directory, or to any
   other directory in your path. (Check if you already have it and only copy
   the DLL if the date is more recent than the existing one)

2) Copy the file "Cw3215.dll" to your "\WINNT\SYSTEM32" directory, or to any
   other directory in your path. (Check if you already have it and only copy
   the DLL if the date is more recent than the existing one)

3) Copy the file "Blat.exe" to your "\WINNT\SYSTEM32" directory, or to any
   other directory in your path.

4) Run "Blat -install yourhost.site.blah.blah youruserid@site.blah.blah"

WHAT'S NEW IN THIS VERSION

version 1.7.4
 - Minor correction to return values in the event of server timeout

version 1.7.3
 - Fixed "-attach"ing of largish files (but in calculation of internal
   space required).

version 1.7.2
 - Added "-attacht" which enables attaching multiple files without base64
   encoding them.

version 1.7.1
 - Minor command line parsing bugs fixed

version 1.7
 - Added command line option "-port" to allow usage of a proxy listening on
   many ports and redirecting toward many SMTP servers.
 - Added command line option "-try" to avoid "time-out" error message when
   using phone-line connection or "Too many users connected" error message when
   using a proxy.
 - Added these options to the registry. Added profiles to the registry for ease
   in choosing server, user, retries and port.
 - Added a "-profile" to see the existing profiles.
 - Added a "-profile -delete" to delete a profile.

version 1.6.3
 - Added command line option "-attach" to allow attaching multiple
   binary files to a message.
 - "-base64" causes inclusion via 'attachment' method instead of 'inline'

version 1.6.2
 - Added command line option "-o" to provide Organization field
   in the headers of the sent message.

version 1.6
 - Added support for mailing of binary files (mime base64 encoding)
   which will make it possible to mail ANY file.
 - Fixed argument parsing for '-q' and '-mime' options (these used
   to only work if they were the last argument)

version 1.5
 - Two bugs were corrected that made Blat generate exceptions with certain
   CC or BCC adresses.
 - Blat now generates descriptive error messages, rather than the infamous
   "gensock error 4017" type errors
 - Blat now returns an error code when the SMTP session fails
 - A new option -mime was added. This implements the possibility to use
   the MIME quoted-printable transfer encoding. The assumptions are:
        1: The file is a text file
	2: The charset is ISO 8859/1


USAGE:

syntax:
Blat <filename> -t <recipient> [optional switches (see below)]
Blat -install <server addr> <sender's addr> [<try n times> [<port> [<profile>]]] [-q]
Blat -h [-q]

-install <server addr> <sender's addr>: set's default SMTP server and sender
or
Blat -install <server addr> <sender's addr> [<try n times> [<port> [<profile>]]] [-q]


<filename>    : file with the message body ('-' for console input, end with ^Z)
-t <recipient>: recipient list (comma separated)
-s <subj>     : subject line
-f <sender>   : overrides the default sender address (must be known to server)
-i <addr>     : a 'From:' address, not necessarily known to the SMTP server.
-c <recipient>: carbon copy recipient list (comma separated)
-b <recipient>: blind carbon copy recipient list (comma separated)
-o <organization>: Set Organization to appear in the header fields
-h            : displays this help.
-mime         : MIME Quoted-Printable Content-Transfer-Encoding.
-base64       : MIME base64 Content-Transfer-Encoding.
-q            : supresses *all* output.
-server <addr>: overrides the default SMTP server to be used.
-port	      : overrides the default port on the server.
-try          : set how many time blat should try to send a message.
-p <profile>  : uses stored profile for server, sender, try and port.	
-attach <file>: attach binary file to message (may be repeated)
-attacht <file>: attach text file to message (may be repeated)

Note that if the '-i' option is used, <sender> is included in 'Reply-to:'
and 'Sender:' fields in the header of the message.


EXAMPLES:

Blat -install smtphost.bar.com foo@bar.com          // Sets host and userid
Blat -install smtphost.bar.com foo                  // Sets host and userid
Blat -install smtphost.bar.com                      // Sets host only

Blat myfile.txt -s "A file for pedro" -t foo@bar.com
// Sends a file with subject line "A file for pedro"

Blat myfile.txt -s "A file for pedro" -t foo@bar.com -q
// Sends a file with subject line "A file for pedro" and does not print
// informative messages on the console

Blat myfile.txt -s "A file for mark" -t fee@fi.com -f foo@bar.com
// -f option overrides the default sender

Blat myfile.txt -s "A file for pedro" -t foo@bar.com -i "devil@fire.hell"
// -i replaces "From:" line address (but leaves Reply-To: and Sender: lines)

Blat myfile.txt -s "animals" -t fee@fi.com -c "moo@grass.edu,horse@meadow.hill"
// -c mails carbon copies to users moo@grass.edu and horse@meadow.hill


FUTURE IMPROVEMENTS (you can do it!)

1) auto-detect when -base64 is required.
2) reorganize the code (fat chance!)
3) get rich (fat chance!)
4) go on holidays... (done: Sri Lanka, NZ, Portugal, France, Denmark)
5) go on holidays again... (any offers?)

COPYRIGHT

License to use Blat

The authors of Blat have placed it in the public domain. This means you
can use it free of charge for any purpose you like, with no conditions being
placed on its use by us. The source code is also available free of charge and
under the same conditions as the executables.

You have permission to modify, redistribute, hoard, or even sell Blat in its
executable or source form. If you do sell Blat, though, we'd appreciate it if
you'd provide your own support (and send us a free copy).  We cannot take any
support load for Blat (we've got better things to do).

Various bits of the source code are copyright by other people/organizations.
Look in the source code for copyright ownership.

The authors of the package are not responsible for any damage or losses that
the usage of Blat may cause. We are especially not responsible for the misuse
of the SMTP (or other) mail system.


AUTHORS

Mark Neal    (mjn@aber.ac.uk)
Pedro Mendes (prm@aber.ac.uk)


CONTRIBUTORS

We'd like to thank:

the WinVN team                       - wrote gensock.dll and the excellent WinVN
                                       newsreader from which we copied most of
                                       Blat's code (PD apps are nice!)
Beverly Brown (beverly@datacube.com) - fixed the argument parsing
Bob Beck (rbk@ibeam.intel.com)       - added console input (even though we did
                                       not use his code in the end...)
Axel Skough (axel.skough@scb.se)     - added the MIME code, fixed the CC/BCC
                                       bug and added the return code
Tim Charron (tcharron@interlog.com)  - Added base64 encoding code
Tim Charron (tcharron@interlog.com)  - Added -o command line
Tim Charron (tcharron@interlog.com)  - Added multiple binary "-attach"ments
Christophe Henquin (ch@innocent.com) - Added -port, -try and profiles

