HOW CAN I OPEN OUTLOOK MESSAGE WINDOW IN WPF?

Brad Pitt

Total Post:61

Points:429
Posted by  Brad Pitt
WPF 
WPF
 4308  View(s)
Ratings:
Rate this:
Hi!

I have a wpf application and I'd like it to use Outlook to send messages any user.

I don't want to send them programmatically though; I just want to open

The New Message window, set the recipients and leave it there for the

User to finish filling out.

What classes am I looking for?

please help me thanks in advance!

  1. shreesh chandra shukla

    Post:105

    Points:735
    Re: How can I open outlook message window in wpf?

    Hi!

    You can firstly add reference to the Outlook Interop and after that write below line of code where you want to open a Outlook message window in wpf.

    Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.Application();

                Microsoft.Office.Interop.Outlook.MailItem message =

                (Microsoft.Office.Interop.Outlook.MailItem)outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);

                message.Subject = "Testing Mail!";

                message.Recipients.Add("some@email.com");

                message.Body = "Hello. This is body area, write your mail here.";

                //int attachmentLocation = 1;

                //message.Attachments.Add(fileName, Outlook.OlAttachmentType.olByValue,attachmentLocation, displayName);

                message.Display(false);

    thanks.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!