You have to make use of a combination of both Alternate Views and Linked resources in order to embed images in e-mail.
Imports System.Net.Mail
Imports System.Net.Mime
Public Class EmailMessage
Sub New(ByVal body As String, ByVal isHtml As Boolean, Optional ByVal subject As String = DefaultSubject)
p_messagesubject = subject
Message.Subject = MessageSubject
Message.Priority = MailPriority.High
Message.IsBodyHtml = isHtml
If isHtml Then
p_htmlmessagebody = body
Dim htmlContent As ContentType
htmlContent = New ContentType("text/html")
Dim htmlView As AlternateView
htmlView = AlternateView.CreateAlternateViewFromString(HtmlMessageBody, Nothing,
MediaTypeNames.Text.Html)
Dim logo As LinkedResource = New LinkedResource("c:\mylogo.jpg")
logo.ContentId = "MyEmbeddedLogo"
logo.TransferEncoding = System.Net.Mime.TransferEncoding.Base64
htmlView.LinkedResources.Add(logo)
Message.AlternateViews.Add(htmlView)
Else
p_messagebody = body
Message.Body = MessageBody
End If
End Sub
End Class
Now, in order for the logo to show up you have to have a standard HTML img tag inside the HtmlMessageBody whose src attribute is set to the name of the ContentId
<img src="cid:MyEmbeddedLogo" />