Messaging.SendEmailResult Type cannot be constructed?

Yes you can construct the Messaging.SendEmailResult using the JSON deserializer

Messaging.SendEmailResult  er =(Messaging.SendEmailResult) JSON.deserialize('{}', Messaging.SendEmailResult.class);
System.debug(er);

Get your instance. Happy Days.


Since the properties of this class are not in the official salesforce documentation, hopefully this helps someone. If you need to create an instance of this that return false for isSuccess()

Messaging.SendEmailResult failedMessageResult = (Messaging.SendEmailResult)JSON.deserialize('{"success":false}', Messaging.SendEmailResult.class);