patrick118
Technical User
I have the following script
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "test@test.com"
objMessage.To = "test@test.com"
objMessage.AddAttachment "c:\test.txt"
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.
objMessage.Configuration.Fields.Item _
(" = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
(" = "Mailserver"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
(" = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
============================================================
Now i don't want to get test.txt as an attachment but i would like to get all the text files in the directory so i tried *.txt but doesn't work.
Is there a way of getting all the txt files in a directory?
Thanks for the help.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "test@test.com"
objMessage.To = "test@test.com"
objMessage.AddAttachment "c:\test.txt"
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.
objMessage.Configuration.Fields.Item _
(" = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
(" = "Mailserver"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
(" = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
============================================================
Now i don't want to get test.txt as an attachment but i would like to get all the text files in the directory so i tried *.txt but doesn't work.
Is there a way of getting all the txt files in a directory?
Thanks for the help.