0 votes

I'm using this code but when i read the email with outlook i can't see the image.
help please

Dim builder As New MailBuilder()

' Set From, To    
builder.From.Add(New MailBox("alice@mail.com", "Alice"))
builder.To.Add(New MailBox("bob@mail.com", "Bob"))
builder.Subject = "Test"

' Set HTML content (Notice the src="cid:..." attribute)
builder.Html = "<html><body><img src=""cid:image1"" /></body></html>"

' Add image and set its Content-Id    
Dim visual As MimeData = builder.AddVisual("c:\image.jpg")
visual.ContentId = "image1"

Dim email As IMail = builder.Create()
edited by

1 Answer

0 votes

The code is correct. The only thing that is not 100% standard compliant is the cid value - it should have email format, like 'image1@example.com' for example.

If the image doesn't appear, it's an Outlook bug.

If you want us to check this message send it to the support email address, that can be found in the footer.

by (270k points)