MAILIT - Version 2.1 ==================== HI! MAILIT is a command line utility with SMTP email client, to send email from a batch file. This can be useful for network administrators who need some sort of automated information from a server (or client) machine. Requirements: ------------- TCP/IP protocol and available SMTP server are required. MAILIT can run under Win9x/NT/2000/XP/2003. Usage: ------ copy MAILTEST.BAT to another file and edit it as needed. Tips: ----- * Create your own BAT/CMD file, that receives a parameter like the message text (string of filename), the recipient email address, and/or the file to attach. Your custom BAT file will use predefined values of MAILIT_SERVER ,MAILIT_FROM, and other values that are constant in your implementation, while using parameters (%1 %2) for variable values. Remember that if you call a BAT file from another one, you should use the CALL command. * Do some tests to see that it's working as you want it to (obvious isn't it?). * If you get an "Out of environment space" error in Win9x, add the following to CONFIG.SYS: SHELL=C:\COMMAND.COM /E:1024 /P More Info: ---------- * SET MAILIT_SERVER=127.0.0.1 The IP address or DNS FQDN of your SMTP mail server. * SET MAILIT_FROM=myself@mymailserver Some SMTP servers require a valid FROM address, otherwise you might get an NDR when the server denies to "Relay" your message. * SET MAILIT_TO=myfriend@hermailserver You must supply a valid destination of course... This address can be your email address or any other. In this version you can specify multiple recipients using comma (,) or semicolon (;). * SET MAILIT_SUBJ=MAILIT Test Trivial... * SET MAILIT_MSGTEXT=This is the first line of the message body (Optional) This value will be added to your message as the body text. Use it when you want to send a short message of a single line. * SET MAILIT_MSGFILE=MAILIT.TXT (Optional) When you need to send a longer message, or an ASCII/ANSI text file (like a LOG from other program). This is the filename of the text file to send. * SET MAILIT_ATTACH=MAILIT.TXT (Optional) Send any file as attachment. Strating from version 2.0 of MAILIT you can send multiple files: + You can use regular wildcards * and ? + You can write multiple file names in CSV format (file names separated by comma) Examples: SET MAILIT_ATTACH=FILE1.TXT,FILE2.BMP SET MAILIT_ATTACH=*.LOG, SET MAILIT_ATTACH=2005-03-??.TXT Note: you can use only one MAILIT_ATTACH line in your batch file. If you need more room for filenames, use SET MAILIT_FilesList (see below). * SET MAILIT_FilesList=FileNames.txt (Optional) You can also create a text file with list of filenames separated by lines and/or comma symbol, using the same syntax as used by the SET MAILIT_ATTACH parameter. * SET MAILIT_SingleAttachPerMail=1 (Optional) If you set this to 1, and you send several file attachments, then the program will send each attachment in a separate email message, instead of sending a all the attachments in one big email. * SET MAILIT_CC= * SET MAILIT_BCC= Send to CC or BCC recipients. * SET MAILIT_USERNAME= * SET MAILIT_PASSWORD= If your SMTP server requires authentication, you can provide user name and password. If you don't need authentication, then make sure that the "MAILIT_USERNAME" environment value is empty or does not exist. Please note that storing username and password in a plain text batch file is not the best idea from security prespective, so try not to use this option if possible, or find the best way to protect your passwords. FreeWare: --------- This version of MAILIT is FreeWare, you may copy and use it free of charge. If you use MAILIT, please send me an email with some info about yourself and how MAILIT is used. Version History: ---------------- Version 2.1, July 2005 - + Added support for SMTP authentication. Version 2.0, March 2005 - + Added support for multiple attached files. + Added numeric runtime errors and changed text error messages. - Many changes in the program source code, error handling, and structure. Version 1.3, September 2004 - Added support for CC and BCC recipients. Version 1.2, February 2003 - Added support for longer variables (previous versions limit was 64, now it is 256 characters). Version 1.1, August 2002 - Allow multiple recipients in the MAILIT_TO variable, for example: SET MAILIT_TO=user1@host1.com;user2@host2.org A comma (,) or semicolon (;) can separate recipients. Version 1.01, July 2000 - Additions to the MAILIT.TXT file only (this file). Version 1.0, June 2000 - First Release. Contact and other info: ----------------------- MAILIT was written by Yizhar Hurwitz, from Israel, using Delphi 3. MAILIT will be part of my NUTS collection of network utilities, available for free download from my site. My email: yizhar@mail.com My Site: http://yizhar.mvps.org http://www.new-ofek.co.il/yizhar The SMTP implementation was written by Francois PIETTE francois.piette@rtfm.be http://www.rtfm.be/fpiette I just added the command line usage of it. Thanks Francois! Enjoy Yizhar