function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
naresh.sfdc1.3885733215764783E12naresh.sfdc1.3885733215764783E12 

Sending Email Through Apex

Hi ,

I want to Send an Email to my customer which he gave in VF Page along with i want to send Thank you Image.
This Image is in Documents. I retrieved that Document in Apex based on Name but am not able to add this image in Sended Email.
Query :       Document DC= [Select id,Name from Document where Name = 'Ajelite site/Contact us Thank you Image'];

I tried with this code,but am not able to send image.
String  strDocUrl = '/servlet/servlet.FileDownload?file='+lstDocument.Id;
        System.Debug('The body of the mail is '+strDocUrl);
        String htmlBody =  strDocUrl +' <br/> </b> Dear' + c.First_Name__c +', </b> <br/> ';

How can i add this document image in Email.
Vinita_SFDCVinita_SFDC
Hello,

Please check if the option “Externally Available Image” is checked in the documents.

Refer: http://help.salesforce.com/apex/HTViewSolution?id=000086448&language=en_US