+ Start a Discussion

Parsing Email Addresses in Text Body


I have an inbound email handler and am hoping to parse the email addresses that enters into Salesforce. I need help to only parse the email addresses from the 'To:' which will be located in the 'Text Body' of the email. What is the best way to only capture these individual emails and add it to a List of Contact emails? Provided below is an example of a email:

---------- Forwarded message ---------
From: John Smith <smith@gmail.com>
Date: Mon, Nov 4, 2019 at 10:19 PM
Subject: Test Email Handler
To: <brown@gmail.com>, <wayne@gmail.com>

This is a test email description.