Hi folks, I've got a vbscript I've put together that I plan to use to send out a log file once a day. The trick I'm running into is that there's no way to make the name of the log file static so I can reference it directly in the script. What I'd like to figure out then is how I can have the script just grab the first file it sees in the folder and attach it in the email. Here's what I've got so far:
'Send Log File
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "firstname.lastname@example.org"
objMessage.To = "email@example.com"
objMessage.TextBody = "This is some sample message text."
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mysmtpserver"
'Server port (typically 25)
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'==End remote SMTP server configuration section==