I am struggling a bit on how to set the sender address on an outlook mailitem, for an outlook plu-in we have developed. Couln't find any working examples. I am able to set all the mail parts with below code sample. Except the sender details. I want to send out the email from using a different account on the exchange, for which I have a user ID (email-id) and password Eg : [email protected] / Password123. Can you guide me on how I can set these details as sender.
Outlook.MailItem mailItem = this.OutlookItem as Outlook.MailItem;
mailItem.Subject = "Follow Up : Level ";
mailItem.HTMLBody = "<html><div style='font-size:10.5px; font-family:Tahoma;'>" + GetSummaryTable().ToString() + "</div></html>" + mailItem.HTMLBody;
mailItem.To = string.Join(";", new List<string>(MailToList.Distinct()));
mailItem.CC = string.Join(";", new List<string>(MailCCList.Distinct()));
mailItem.Importance = OlImportance.olImportanceHigh;