Page 1 of 1

email notification

Posted: 18 May 2009 07:52
by t4mack
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

Posted: 26 Aug 2009 23:11
by DccD
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/