DisplayName
is a property of the MailAddress
class. You can use this overload of the constructor to specify it:
x.From = new MailAddress(address: "customerservice@xyzCompany.com", displayName: "xyz Company Customer Service");
Update based on comment:
The DisplayName
property has no (or a private) setter, meaning you can only set it through the constructor of MailAddress
, but not through the property itself.