AuthorAnkur Dalvi

Sending a VF Page as Attachment in Mail through Apex Class


Following code can be used for sending a vf page as an attachment with an email: public class Gene_PDF{ public PageReference sendPdf(){                PageReference pdf = Page.mail_pdf;//mail_pdf is the name of vf page      pdf.getParameters().put('email',email);      // goToNextPage('email');     Blob body;                try{         body = pdf.getContent();      }catch(VisualforceException e){...