Command line SMTP mailer is a common tool for batch jobs and tasks automation.

BMail is a small command line application allowing to send emails directly from command line.

The utility has simple command line parameters:

C:\>bmail /?

	Command Line SMTP Emailer V1.07
	Copyright(C) 2002-2004
	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.

So lets say after your script completes you need to send an email that the script has been executed you can use this simple command:

bmail -s -t yourem@ail -b -h -a “Script Complete” -b “You are good script developer. Your script worked!”

bmail -s -a "db01-OK-?" -t -f oracle@prod01 -m BACKUP.LOG


Bmail is available free of charge. You can download bmail from here. After your download completes you need to extract bmail executable from archive and place it in any convenient location.


2 responses to this post.

  1. I am glad to be a visitant of this stark web blog, thanks for this rare information!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: