klewis10367
MIS
How would you update this code to add an attachment that changes names when run. It goes to the same path but the log number changes everytime I run my application.
SMTPServer = "mbhqex07"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "kevin.lewis@burroughs-chapin.com"
objEmail.To = "kevin.lewis@burroughs-chapin.com"
objEmail.Subject = "TSW Next Integration Failed for" & " " & Date-1
objEmail.Textbody = "Please click the attached link to view the TSW Next Integration Error File"
objEmail.AddAttachment "C:\Scripts\Output.txt"
objEmail.Configuration.Fields.Item _
(" = 2
objEmail.Configuration.Fields.Item _
(" = SMTPServer
objEmail.Configuration.Fields.Item _
(" = 25
objEmail.Configuration.Fields.Update
objEmail.Send
SMTPServer = "mbhqex07"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "kevin.lewis@burroughs-chapin.com"
objEmail.To = "kevin.lewis@burroughs-chapin.com"
objEmail.Subject = "TSW Next Integration Failed for" & " " & Date-1
objEmail.Textbody = "Please click the attached link to view the TSW Next Integration Error File"
objEmail.AddAttachment "C:\Scripts\Output.txt"
objEmail.Configuration.Fields.Item _
(" = 2
objEmail.Configuration.Fields.Item _
(" = SMTPServer
objEmail.Configuration.Fields.Item _
(" = 25
objEmail.Configuration.Fields.Update
objEmail.Send