1

I've tried many VBScripts that suggest to include embedded images in Outlook emails but none have worked for me so far.

I used the following VBScript that opens Outlook and sends a email. This works OK but is not what I want.

The script includes some HTML to format the email content and also includes the possibility to send attachments.

What I want to do is to send the image in the body of the email as a embedded image. How can I do that?

Here's the script:

Set MyApp = CreateObject("Outlook.Application")
Set MyItem = MyApp.CreateItem(0)

With MyItem
.To = "email1@email.com;email2@email.com"
.CC = "email3@email.com"
.Subject = "Your Subject here!"
.HTMLBody = "<HTML><BODY><FONT face=Calibri color=#000000 size=3>Insert your text here!<br><br><img src='http://image001.png' alt=''>&nbsp;<img src='http://image002.png' alt=''></FONT></BODY></HTML>"
.ReadReceiptRequested = False
.Attachments.Add("http://attachment1.png")
.Attachments.Add("http://attachment2.jpg") 
End With
MyItem.Send 

Note: Not VBA, but VBScript. Note 2: this is not the same code as in Sending Outlook Email with embedded image using VBS and the code solution provided in this post is not working either.

Community
  • 1
  • 1
Malbordio
  • 92
  • 3
  • 4
  • 20
  • The cod above that attach the images in the body of message via set the HTMLBody property should work. To narrow down this issue, I suggest that you copy the HTML to an HTML file to see whether the image could display correctly. – Fei Xue Jun 14 '16 at 01:52
  • The code works, as I said, but I wish to have it embedded in a outlook email instead. The image should be included inside the msg message. – Malbordio Jun 14 '16 at 08:01
  • try to remove the code like `.Attachments.Add("http://attachment1.png")` – Fei Xue Jun 14 '16 at 08:11

0 Answers0