Need example in VB2005 code for sending Emails with images!
Please post any links you might think will help me understand and develop a small application for sending emails containing an image not as an attachment but instead images placed along with the text.
If this cannot be done then I will settle for having the Image as an attachment. I’m only interested in Sending; I’m not interested in receiving Emails.
Thanks ALL
You have to use HTML.
This is code that sends the email.
| |
Dim Message1 As New System.Net.Mail.MailMessage(TextBoxFrom.Text, TextBoxTo.Text) Dim S As New System.Net.Mail.SmtpClient Dim str As String Dim F As New OpenFileDialog F.ShowDialog() Str = F.FileName Message1.IsBodyHtml = True Message1.Body = "This is a test" & "<img Src = '" & str & "'>" S.Host = TextBoxHost.Text S.Send(Message1) |
TextboxFrom, TextBoxTo, and TextBoxHost are textboxes that are added to the form
You use HTML in the body of the message.
Here is a site about HTML http://www.htmlgoodies.com/