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
Ajay Kumar Lankipalle 8Ajay Kumar Lankipalle 8 

VF email template preview error...

Hi,
I am trying to use VF email template as follows. The output is fine after sending the mail but the problem is it is not showing the preview before we send the mail.
VF Template
--------------------------------------
<messaging:emailTemplate subject="Thank you for your Support!" recipientType="Contact" relatedToType="Program__c">
<messaging:htmlEmailBody >
<html>
<body>
<img alt="Logo" src="https://XXXXXXXXXXX/servlet/servlet.ImageServer?id=015V00000004tUD&oid=00DV00000002MuC&lastMod=1330685229000" />
<p>{!relatedTo.Id}</p>
<c:ServiceComponent ProgramId="{!relatedTo.Id}"/>
<form>
<script type="text/javascript">
function confirmGetMessage() {
var theAnswer = confirm("Do you want to continue????");
if (theAnswer==true){
alert("You have triggered the approval process.");
}
else{
alert("You have not triggered anything.");
return false;
}
}
</script>
</form>
<br/><br/>
<br/><br/>
</body>
</html>
</messaging:htmlEmailBody>
<messaging:attachment renderas="pdf" filename="{!recipient.Name}-Service Form.pdf">
<html>
<body>
<h3></h3>
<c:ServiceComponent ProgramId="{!relatedto.Id}"/>
</body>
</html>
</messaging:attachment>
</messaging:emailTemplate>
-----------------------------------------------
Screenshot attached for your reference.
Can any one help me in this please?
Thanks,
AjayUser-added image
nbknbk
Can you generate one sample email through  'Send Test Verifiy Merge' fields and see the preview. You might able to see the preview. Other wise might be an issue with some of code in your template (Javascript, img tags..etc). Try to remove block of code and check the preview. You will ge the exact issue.

Hope it helps