Reputation: 5490
I have an app that collects logging information. I want users to be able to click a button to create an email in Outlook with an attachment containing the logging data they're looking at, and then let them edit the email to put in any additional information, add additional recipients, etc. before they hit send.
I can find plenty of info on automatically creating and sending an email - but nothing on creating the email and then letting the user edit it first.
(I'm happy with an Outlook solution here because it's an internal app and everyone has Outlook).
Upvotes: 1
Views: 240
Reputation: 510
Take a look at this article:
Create and show a new Outlook message programmatically
Upvotes: 0
Reputation: 11105
If you have a procedure that generates a lot of emails you can save them in drafts folder:
email.Move(appOutlook.GetNamespace("MAPI").GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderDrafts))
Upvotes: 1
Reputation: 6735
var outlookApplication = new Application();
var inbox = outlookApplication.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderInbox);
if (inbox != null)
{
var email = outlookApplication.CreateItem(OlItemType.olMailItem);
...
email.Display(true);
}
Upvotes: 1