I need to achieve following
1- Save email message as draft which user can later open, modify and send manually
2- Compose email and open outlook as new email and allow user to send or discard then and there
There are sample codes using both Microsoft.Office.Interop.Outlook
and SmtpClient
. I believe SmtpClient
can not automate Outlook. And, for the second option i do not want to add reference of Microsoft.Office.Interop.Outlook
because what if Office Outlook is not installed!!!
So please guide me for further readings.
Edit
Using no reference will surely enable the form to get open even if outlook is not installed and this can be checked by just checking null for oType
after
Type oType = Type.GetTypeFromProgID("Outlook.Application");
What if i add reference and client opens the form and outlook is not there OR referenced library is Office 2013 and installed library is Office 2010? would the form open or throw exception OR following lines will still work?
Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();
Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");