[SalesForce] Adding an image from a document tab to email template

I have many images in document tab and all are externally available. When I try to add the image in HTML & VF email template, the images look broken in outlook when its received.

enter image description here

I thinks thats a minor error that's causing this. Any help is appreciated.

<messaging:emailTemplate subject="Details -" recipientType="User" relatedToType="Evaluation__c">
<messaging:plainTextEmailBody>

    Congratulations! This is your new Visualforce Email Template. Hello, Sample Image below: <br/>
    <apex:image url="https://aec.cs51.content.force.com/servlet/servlet.FileDownload?file=0254B0000000WmD" />

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

Note: When the url is opened in different browser, it requires login.

Best Answer

open document tab,and image what u want to display,right click on image copy and paste it in <apex:image >

<messaging:emailTemplate subject="vf template" recipientType="Contact" >   
   <messaging:plainTextEmailBody >
    Congratulations! This is your new Visualforce Email Template. 
    <apex:image url="sahitya0907-dev-ed--c.ap2.content.force.com/servlet/…; /> 
</messaging:plainTextEmailBody> </messaging:emailTemplate> 
Related Topic