EmailMessage.from

Represents the From: and Reply-To: header values in the email.

More...
class EmailMessage
EmailRecipient from;

Detailed Description

Note that the from member is the "From:" header, which is not necessarily the same as the "envelope from". The "envelope from" is set by the email server usually based on your login credentials. The email server may or may not require these to match.

Meta

History

On May 13, 2024, the types of these changed from plain string to EmailRecipient, to try to get the encoding easier to use correctly. EmailRecipient offers overloads for string parameters for compatibility, so your code should not need changing, however if you use non-ascii characters in your names, you should retest to ensure it still works correctly.