Open scastria opened 5 years ago
It looks like the solution is to use the EmailMessageBuilder class. However, I still think the code is wrong in that if a method accepts an IEmailMessage, it should accept ANY class that implements that interface. If the method needs to cast the argument to a concrete EmailMessage, then THAT concrete class should be the argument type.
There are 2 ways to send an email:
SendEmail(IEmailMessage) SendEmail(string,string,string)
The second option is NO GOOD if you need to specify a CC recipient. Therefore, I MUST use the first option.
The first option IS COMPLETELY BROKEN!! The concrete EmailMessage class that implements the IEmailMessage is marked INTERNAL. Therefore, the only way to use the first option is to write my own class that implements IEmailMessage. That WILL NOT WORK either since the Android implementation of EmailTask tries to cast the IEmailMessage argument as the internal EmailMessage class to check for isHtml. Of course, my class cannot be cast as the internal EmailMessage because it is INTERNAL.
Either make the internal EmailMessage public OR modify the IEmailMessage interface so that it includes isHtml so that the Android implementation does NOT have to cast the argument as the concrete EmailMessage class.