zachvaldez
asked on
Sent email using Shared Mailbox from outlook in C#
I would like to send emails using the Shared Mailbox so that the 'From' property displays the Shared Mailbox name instead of my personal
email. How is that done. I use the Microsoft Office Interop.Outlook library.
So far this is my code..
email. How is that done. I use the Microsoft Office Interop.Outlook library.
So far this is my code..
// Create the Outlook application.
Outlook.Application oApp = new Outlook.Application();
// Get the NameSpace and Logon information.
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");
oNS.Logon(Missing.Value, Missing.Value, true, true);
----- somewhere here I'd like to switch it to the Shared Mailbox name
// Create a new mail item.
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
// Set the subject.
oMsg.Subject = "Send Email in HTML ";
ASKER
How do you set it to switch to the shared mailbox? And so what code can accomplish this? Thanks
in your oMsg object, don't you have a From property?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
need exchange server to set settings sentonbehalf property fixed it!! Thanks
You need to login to your regular mailbox and then set the From property to the shared mailbox email address.