Embedding a picture into an email

papasmurfuo9

Registered User.
Local time
Today, 00:50
Joined
May 28, 2014
Messages
69
Hi
im trying to embed a picture in an email, code below
any ideas?
thanks

Code:
Dim MyOutlook As Object
Dim MyMail As Object
Set MyOutlook = New Outlook.Application
Set MyMail = MyOutlook.CreateItem(olMailItem)

Application.Echo False
With MyMail
.BodyFormat = olFormatHTML
.Display
Signature = MyMail.HTMLBody
.To = ""
.CC = ""
.Subject = ""

.Display

Body = "<html><body><p style=""font-family:arial;color:rgb(0,0,0);font-size:13px;"">"
Body = Body & "Hi,<br><br>Please find attached your contract pricing file.<br><br>"

Body = Body & "<img src=cid: H:\My Documents\Contract.jpg></img><br><br>"

Body = Body & "Kind Regards<br><br>"

Body = Body & Signature
.HTMLBody = Body

.Display
End With
Application.Echo True

Set MyOutlook = Nothing
Set MyMail = Nothing
 
I think the path to the image source needs to be in it's own quotes;

Body = Body & "<img src=cid: 'H:\My Documents\Contract.jpg'></img><br><br>"
 
hi

just get a box with a red cross inside,
thanks
 
Just to see if it's a formatting issue or a "can't find it issue" try linking to a web based image on a external known good link (e.g something from an external email that works?)

If that works your code is good just not the way you are addressing it.
 

Users who are viewing this thread

Back
Top Bottom