Link to home
Start Free TrialLog in
Avatar of m0tSiE
m0tSiE

asked on

Send embedded image from Resources in VB.Net?

Hi,

I've currently got a form that i'm using to send html emails, however I want to send an image in these email that will always be the same.

Therefore I have added the image to the resources of my form, however I cant seem to embed it in the email.

Can anyone show me how to amend my code to do this?

QuickM_il.My.Resources.Resources.logo is the image I am trying to embed.

Thanks,

Paul.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        OutApp = CreateObject("Outlook.Application")
        OutApp.Session.Logon()
        OutMail = OutApp.CreateItem(0)
 
        PictureBox1.Image = QuickM_il.My.Resources.Resources.logo
 
 
        strbody = "<html><body><font color='red'>TEXT</font></b><br><br><img src=""PictureBox1.Image""></body></html>" & _
                  "Dear all," & vbNewLine & vbNewLine & _
                  "This is a test email." & vbNewLine & _
                  "" & vbNewLine & _
                  "" & vbNewLine & _
                  "Thanks and regards," & _
                  "" & vbNewLine & _
                  "Paul"
    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of tiagosalgado
tiagosalgado
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of m0tSiE
m0tSiE

ASKER

Cheers Tiger,
I managed to do it using...

.Attachments.Add("c:\temp\candice2.jpg")

And then just typing the filename in the img src field :D