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
Sohel Shaikh 23Sohel Shaikh 23 

How to read email and its attachement using apex?

I want to check if my mailbox has received an email from specific sender and read the excel sheet attached to it and use the data in excel sheet in my apex code.
N.M. SharmaN.M. Sharma
Hi Sohel,

You can make a trigger on EmailMessage and then check if whatever specific sender you want in it.
Please check this link:

And for checking Attachment make a query on attachment where ParentId =

Using this you easily grab your file.