Command Line SMTP Mailer for Batch Jobs

Uses BMAIL tool that you can download from
http://retired.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm

Example

@rem ---------------------------------------------------------------------------
@rem Script to run instant restore and report any failure
@rem It uses bmail utility for sending mails from CLI
@rem Download bmail from:
@rem http://retired.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm
@rem ---------------------------------------------------------------------------

chcp 1252
pushd .
cd /d "C:\Program Files\Tivoli\flashcopymanager"
set rc=0
 
fcmcli restore T: /InstantRestore=Yes /noprompt

 
if %errorlevel% neq 0 set rc=%errorlevel%
If %rc% neq 0 bmail -s 10.193.19.25 -t to-johndoe@yourmailserver.com -f from-address@myserver.com -h -a "Storwize V7000 RESTORE Failed" -b "Tivoli Flashcopy Manager 3.1 RESTORE NASSJO-10 failed"

popd
exit %rc%

Advertisements
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s