• Peter Limbach
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

We have a repository that holds text for email as pure HTML.  I have some code to send email with this text as the html body and that works well and is fairly simple.  We can also add attachments.

What I haven't figured out how to do is embed and image in the email.  From what I understand, the email would have in it a "cid:" URL like --
 

<img width="128" height="128" id="Picture_x0020_1" src="cid:image001.png@01CF6E9E.C4B30B30">
I could compose a tag like that no problem.  The issue is the cid: for the image.  I know how to add attachments.  And I know you can set the inline flag to true or false.  What I can't see a way to do is set the id for an attachment I'm including (or get back an ID after attaching it) so I can then put that content id (cid:) in the URL in the HTML body.

It may be that the email and attachment classes in Apex are just not deep enough to perform this task.  But if anyone know's a way to do it, feel free to post suggestions.




I