SET mail_server = "mail.local" SET connected = "n/a" FTPLOGON "ftp.mysite.com" /user="UserID" /pw="secret" IFERROR GOTO send_email SET connected = %datetime GOTO done :send_email ;; If we reached this line we had max failures per cycle SET email_subject = "FTP site unreachable." SET email_body = "Robo-FTP has been unable to connect to the FTP site for at least 10 minutes. " SET email_body = email_body + %crlf + %crlf + "Last successful connection: " + connected EMAIL email_body /subject=email_subject /server=mail_server :done ;; Wait one hour (3600 seconds) between cycles PAUSE /for=3600 GOTO start