email notification

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
t4mack
Posts: 4
Joined: 15 May 2009 12:55

email notification

#1 Post by t4mack » 18 May 2009 07:52

I am currently running ftp via batch and have it set as a scheduled task. I want to add to my batch so that an email notification is sent out via email when the job fails. Here's my batch.

@echo off
rem Your FTP username
set ftpUser=USERNAME
rem Your FTP password
set ftpPass=PASSWORD
rem Your FTP server IP
set ftpIP=192.168.0.2

set ftpFile=%temp%\TempAcc.txt
>"%ftpFile%" echo.%ftpUser%
>>"%ftpFile%" echo.%ftpPass%
>>"%ftpFile%" echo bin
>>"%ftpFile%" echo mget *.*
start ftp -v -i -s:"%ftpFile%" %ftpIP%

thanx

DccD
Posts: 23
Joined: 26 Aug 2009 19:34

#2 Post by DccD » 26 Aug 2009 23:11

Try the errorlevel. If it returns 1 or greater then there was an error and then you can start a program like SendEmail:

Code: Select all

http://caspian.dotconf.net/menu/Software/SendEmail/

Post Reply