I'm learning by myself through the beginner developer Trailhead - I've come across the code to send an email and get results in the first module of Apex Basics & Database, and there are a few things I can't grasp in the syntax even after consulting the documentation.
For example:
Does the following bit mean that the variable 'results' stores an array (pointed by the .SendEmailResult[] ) of what's to the right of the = sign?
Messaging.SendEmailResult[] results = Messaging.sendEmail(
new Messaging.SingleEmailMessage[] { mail });
Why does this line needs to be written if there's a whole inspectResults() method written and after that called in the main public method?
EDIT: Also, what's the utility of the boolean typesendResult
?
Grateful for any help.