Hi all,
Having a bit of an issue sending email with an attachment from my vb.net application.
From the examples i can find on the web which aren't asp.net related I have tried the following, except in vb.net mailattachment is not defined.
but MailAttachment gets an error!
Type 'MailAttachment' is not defined.
Any ideas? or should i try a different approach?
Cheers
daveJam
it works on my machine, so technically i win!
Having a bit of an issue sending email with an attachment from my vb.net application.
From the examples i can find on the web which aren't asp.net related I have tried the following, except in vb.net mailattachment is not defined.
Code:
Imports System.Net.Mail
Dim myMail As New MailMessage()
With insMail
.From = New MailAddress("me@mysite.com")
.To.Add("it@mysite.com")
.Subject = "Test email for attachment"
.Body = "tester"
.IsBodyHtml = True
Dim AttachmentFile As String = my_folder & "file_123.pdf"
Dim attachment As New MailAttachment(attachmentfile)
.Attachments.Add(attachment)
end with
but MailAttachment gets an error!
Type 'MailAttachment' is not defined.
Any ideas? or should i try a different approach?
Cheers
daveJam
it works on my machine, so technically i win!