Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Outlook new mail window c#

I'm looking for a way to open a New mail in Outlook window.

I need programically fill: from, to, subject, body information, but leave this new mail window open so user can verify content / add something then send as normal Outlook msg.

Found that:

Process.Start(String.Format(  "mailto:{0}?subject={1}&cc={2}&bcc={3}&body={4}",    address, subject, cc, bcc, body)) 

But there is no "From" option (my users have more than one mailbox...)

Any advice(s) ?

like image 697
Maciej Avatar asked May 27 '11 06:05

Maciej


People also ask

How do I open the new mail message window in Outlook?

Click New mail icon above the folder list. A new message form will appear in the reading pane.

Why can't I open a new email in Outlook?

Outlook profiles can become corrupted, causing all sorts of problems, including Outlook not opening. Select File > Account Settings > Account Settings. Go to the Email tab. Choose Repair to open the Repair wizard (this option is not available for Outlook Exchange accounts).

How do I open Outlook in Windows 10?

In Windows 10, choose Start, type Outlook.exe /safe, and press Enter. In Windows 7, choose Start, and in the Search programs and files box, type Outlook /safe, and then press Enter. In Windows 8, on the Apps menu, choose Run, type Outlook /safe, and then choose OK.

What does Ctrl F do in Outlook?

The Ctrl+F shortcut in Outlook is used to forward emails. If you want to find some text with keyboard shortcuts, you can use Ctrl+Shift+F. And if you want to find text in an email, you can open the email in a separate window and then click 'Find' in the email as the screenshot below.


1 Answers

I've finally resolved the issue. Here is piece of code resolving my problem (using Outlook interops)

Outlook.Application oApp    = new Outlook.Application (); Outlook._MailItem oMailItem = (Outlook._MailItem)oApp.CreateItem ( Outlook.OlItemType.olMailItem ); oMailItem.To    = address; // body, bcc etc... oMailItem.Display ( true ); 
like image 118
Maciej Avatar answered Oct 06 '22 01:10

Maciej