I know I’m kicking up a very old thread, but I just thought it would be interesting for anyone who (like me) hits upon this through Google.
The issue may be that, while Microsoft specifies that you need to provide a URL to the file you want to attach, you can also provide a normal path. When I do this, it works for me.
Here’s the code I used:
With iMsg
Set .Configuration = iConf
.To = toname
.From = fromname
.Subject = "test mail"
.TextBody = "this is a test mail with attachment"
.AddAttachment "c:\winnt\comsetup.log"
.send
End With
I used a couple literals to test it, but of course, you can replace these with any string specifier you want (string variables, string constants).