+ Start a Discussion
ChandrakanthChandrakanth 

VF email template error

Hi All,
I am stuck in writing a test class due to this error. Can anyone please let me know where i am going wrong.

here is the test class.
EmailTemplate emailTemp = new EmailTemplate ();
    emailTemp.subject = 'Licence reallocations*******';
    emailTemp.HtmlValue='<messaging:emailTemplate subject="Test sub" recipientType="User" relatedToType="MTR_Email_Notification__c"></messaging:emailTemplate>';
    emailTemp.Name ='ChangeLocation';
    //emailTemp.Body ='xxxxxxxxxx';
    emailTemp.developerName = 'test';
    emailTemp.TemplateType='visualforce';
    emailTemp.FolderId = UserInfo.getUserId();
    emailTemp.isActive = true;
    emailTemp.Markup='Body body';
    insert emailTemp;

But whene i run the method i am getting follwing error.Line number 16(from the screen shot) is insert emailTemp.

![enter image description here][1]


 User-added image
PratikPratik (Salesforce Developers) 
Hi Chanz,

I read the error message and it says about Tag, please check your VF page of template and the tag arrangement.

Thanks,
Pratik