R
Robert Dufour
In a windows form app the code I got is
Dim AttachItem As String
If MailAttachments <> "" Then 'The fully qualified paths of all the files
that I want to attach
Dim delimStr As String = ";"
Dim delimiter As Char() = delimStr.ToCharArray()
Dim split As String() = Nothing
split = MailAttachments.Split(delimiter)
For Each AttachItem In split
Dim attachment As New MailAttachment(AttachItem) 'create the attachment
mailMsg.Attachments.Add(attachment) 'add the attachment
Next AttachItem
End If
The line
mailMsg.Attachments.Add(attachment) 'add the attachment does not work the
attachment does not get added when I send the mail I get an object not
created error caused by the attachments I tried to add.
What would be the correct syntax?
I've seen Dim attachment As New MailAttachment(Server.MapPath("test.txt"))
'create the attachment but I think that only works for asp pages in my app
in winforms I get Server is not defined.
I had this stuff working OK in framework 2 and vs2005 but because of
limitations imposed by another third party I'm stuck with framework1.1
Thanks for any help
BOB
Dim AttachItem As String
If MailAttachments <> "" Then 'The fully qualified paths of all the files
that I want to attach
Dim delimStr As String = ";"
Dim delimiter As Char() = delimStr.ToCharArray()
Dim split As String() = Nothing
split = MailAttachments.Split(delimiter)
For Each AttachItem In split
Dim attachment As New MailAttachment(AttachItem) 'create the attachment
mailMsg.Attachments.Add(attachment) 'add the attachment
Next AttachItem
End If
The line
mailMsg.Attachments.Add(attachment) 'add the attachment does not work the
attachment does not get added when I send the mail I get an object not
created error caused by the attachments I tried to add.
What would be the correct syntax?
I've seen Dim attachment As New MailAttachment(Server.MapPath("test.txt"))
'create the attachment but I think that only works for asp pages in my app
in winforms I get Server is not defined.
I had this stuff working OK in framework 2 and vs2005 but because of
limitations imposed by another third party I'm stuck with framework1.1
Thanks for any help
BOB