Get Multiple Info And Put Them Into Email
Hi, I have a batch file which runs and checks several files in the com, and whenever there is an error, I will use a if/else statement to open a redirect.html page which will direct to and open an ASP page which has CDONTS codes on it to send an automated email to the specified email address. However, now as I have more files to check, I would like to check for the existence of 10 files, and if there are like 3 files missing like hello.txt, groom.txt and jack.txt, I would like these 3 to be added into the body of the email message automatically b4 the email message is being send so that when the user receive the email, he/she can know exactly what files are missing from the 10 files. Can this be done?
Batch Codes:
cd C:/Program Files/My Files
@echo off
IF EXIST C:/Program Files/My Files/hello.txt (
echo hello ok
) ELSE (
net send 125.234.23.54 file missing
cd C:\Program Files\My Files\Email
Redirect.html
)
IF EXIST C:/Program Files/My Files/groom.txt (
echo hello ok
) ELSE (
net send 125.234.23.54 file missing
cd C:\Program Files\My Files\Email
Redirect.html
)
IF EXIST C:/Program Files/My Files/jack.txt (
echo hello ok
) ELSE (
net send 125.234.23.54 file missing
cd C:\Program Files\My Files\Email
Redirect.html
)
ASP Codes:
<%
Set Mail=Server.CreateObject("CDONTS.NewMail")
Mail.To="[email protected]"
Mail.From="[email protected]"
Mail.Subject="Missing Files"
Mail.Body="There are some files missing. They are "I want those files which are missing to be added in here.""
Mail.Send
Set Mail=nothing
response.Redirect "EmailSuccess.asp"
%>