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
sateesh.nakerakantisateesh.nakerakanti 

Can any one help me with HTML email body Parsing in Apex

AshwaniAshwani
There is no Native way to do this, apex doesn;t support HTML parsing but you can use regex to remove all HTML tags as:
 
string html = 'your html code';

//regular expression to match all HTML/XML tags
string HTML_TAG_PATTERN = '<.*?>';

// compile the pattern     
pattern myPattern = pattern.compile(HTML_TAG_PATTERN);

matcher myMatcher = myPattern.matcher(result);

//remove all tags and convert to plane
result = myMatcher.replaceAll('');