Free Support Forum - aspose.com

Aspose.Email Form of From Address Set from API

Hello,

Is there a way to make it so that Outlook sees a From address set by the API in the form Last, First instead of Last, First email@example.com? Adding a contact and setting the display as did not seem to fix this.

Thanks for your time

@awalker1,

Is it different than how it looks if sent via Outlook? If we send out a meeting using MS Outlook, it shows Display Name of organizer in this format. Please elaborate your requirements more with the help of existing vs expected results though the API doesn’t have any such settings to change display in MS Outlook.

I was actually just referencing a regular email sender address and not a meeting.

I believe that it may be true that anyone outside the Exchange group may show up with the email and name in the from field once the message is clicked on regardless of display/contact settings, but it also shows the email and name in the folder view (seeing multiple emails at once minimized) where most emails will normally just show the name for someone outside the group.

Basically, I was wondering if setting the from address header as “Last, First” email address in brackets was correct or if I should try something else to just show the name and not name and address when possible.

@awalker1,

You can use the MailMessage.From = new MailAddress(“address”, “DisplayName”) to set the display name to any of your desired value and it will show in the outlook reader pane in that format. Please give it a try and let us know your feedback.

I set the from address to a MailMessage using that line, but it still seems to show display name and email all the time (both in pane and when message is opened). I would like to show just display name when possible.

This MailMessage was added back to a .pst file after being saved in .eml format but it was also a change in the sender address that was originally an MapiMessage.

@awalker1,

Sorry but there is no such settings available that can get you this result using the API. May be this is achievable using MS Outlook but there is no such visualization settings available in the API.