; Create a new log file every time the script runs. ; The log will have the date in it like this: ; daily_upload Oct 30 15.38.43 2007.log ; The file name for the log will be stored in the ; %currentlogfile script variable log "daily_upload" /new ftplogon "myuploadsite" sendfile "file_to_be_uploaded.txt" iferror goto send_error set subject = "SUCCESS" goto done_sending :send_error set subject = "FAILURE" :done_sending FTPLOGOFF ; First, build the e-mail set from_name = "Robo-FTP Script" set from_email = "some@emailaddress.com" set body = "Daily upload results. See attached log for details." set attach = %currentlogfile CREATEMAIL from_name from_email subject body attach ; Next, send the e-mail set to_name = "Bob Smith" set to_email = "bob.smith@mycompany.com" sendmail "my.smtp.server.com" to_name to_email /user=myuserid /pw=mypassword exit