![]() |
|
Bmail is a free but lean command line SMTP mail sender. Don't get fooled into playing $$$ for huge executables. Bmail allows the user to automate the sending of email messages containing log files, data downloads or error messages on Win32 based computers. Together with the freeware utility mpack, you can also send MIME encoded attachments. C:\>bmail -s mars -t cpeacock@max -f root@neptune -h -a "Data Download Script is not Working Correctly" -b "The script on neptune has stopped getting data" Command Line SMTP Emailer V1.07 Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org Opening connection to mars [192.168.0.10] on port 25 220 mars ESMTP Postfix (Release-20010228) 250 Ok: queued as 04168186A7 Bmail has the following options -
C:\>bmail /?
Command Line SMTP Emailer V1.07
Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org
Usage: bmail [options]
-s SMTP Server Name
-p SMTP Port Number (optional, defaults to 25)
-t To: Address
-f From: Address
-b Text Body of Message (optional)
-h Generate Headers
-a Subject (optional)
-m Filename (optional) Use file as Body of Message
-c Prefix above file with CR/LF to separate body from header
-d Debug (Show all mail server communications)
The mail server name, To: Address and From: Address fields are mandatory. Multiple recipients can be specified after the -t by separating them by a comma. The SMTP port number is seldomly used, but can be used to force mail to be sent to a non standard port. The user has two choices for specifying the body of the message. If a single line body is all that is required, it can be specified on the command line using the -b option. In this case you may want to also use -a to specify a subject and -h to add TO: and FROM: headers to the body of your message. However if a larger message body is required, such as a pre-formatted text email, log file, data file or a mime encoded attachment etc then the body of the message can be read from a file. The file can be specified by the -m switch. In this case the user can choose to use the -h, -a and -b switches in conjunction with the file, or manually enter these headers to the top of your file. Usage ExamplesBelow are just some examples showing the use of bmail. If you simply need to send a quick one line email you can use the following example, C:\>mail -s smtp.server -t cpeacock@max -f root@neptune -h -a "Subject e.g. Fatal Error" -b "Body of message e.g. Fatal Error occurred in cgi script, secure.cgi" Command Line SMTP Emailer V1.07 Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org Opening connection to mars [192.168.0.10] on port 25 220 mars ESMTP Postfix (Release-20010228) 250 Ok: queued as B952E42C6F Pipes can be utilised to redirect stdout from a process(s) to a log file, then send this file as the body of the message should an error result. C:\>[ Some Process ] > stdout.txt C:\>if errorlevel 1 bmail -s smtp.server -t cpeacock@max -f root@neptune -h -a "Process Dump" -m stdout.txt -c Command Line SMTP Emailer V1.07 Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org Opening connection to mars [192.168.0.10] on port 25 220 mars ESMTP Postfix (Release-20010228) 250 Ok: queued as 4AFD1186B7 Note should be taken of the -c switch which separates the body from header with a CR/LF combination. While with most mail clients it doesn't make any difference, some versions of Outlook will display an empty body, treating your stdout.txt body as part of the header. With mpack you can use bmail to send mime attachments. C:\>echo Please find attached today's build of mail.exe > body.txt C:\>mpack -s "Today's Build" -d body.txt -c application/exe -o body.msg mail.exe C:\>bmail -s smtp.server -t cpeacock@max -f root@neptune -h -m body.msg Command Line SMTP Emailer V1.07 Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org Opening connection to mars [192.168.0.10] on port 25 220 mars ESMTP Postfix (Release-20010228) 250 Ok: queued as 485CB186A7Download
Other Unique and Innovative Software Solutions from Beyond Logic
Allow users to run trusted applications from defined directories, while preventing the execution of non-trusted programs from floppy disk and CDROM drives or from the users e-mail attachment directory. Stop PE viruses in their tracks where on Windows platforms year, nine out of ten of the top viruses were spread via e-mail. Want a command line utility to view, kill, suspend or set the priority or affinity of processes, perhaps from a batch file? Kills rouge processes where Window's Task Manager fails. Have you ever wanted to run a process such as an application installer, service pack, virus signature update etc or shutdown a single or group of remote computers without having the burden of installing any remote client on your target computers? Have you ever had the need to find, copy or delete files that were owned by a certain user? A great way to back up files created by previous employees or to clean workstations when one leaves. A problem that plagues Windows NT/2000/XP, is it's strict control over I/O ports. Unlike Windows 95, 98 or ME, Windows NT/2000/XP will cause an exception (Privileged Instruction) if an attempt is made to access an I/O port that your program is not privileged to access. The PortTalk driver allows existing programs to access selected I/O ports. Want a quick console utility to display the hardware specifications of a PC including Processors Type, Operating System and Service Pack, Physical and Virtual Memory, Network Addresses, Logical Drive information, Video Card Type, Hard Disk, CDROM and Printer Information. A small and simple utility to instantly view the SMART (Self-Monitoring Analysis and Reporting Technology) attributes of Hard Disk Drives without first requiring installation. |