usar partes herramientas funciones funciona descargar como c# email .net-4.0 office-interop outlook-2003

partes - Cómo abrir Outlook nueva ventana de correo c#



manual de outlook 2016 (3)

Estoy buscando una manera de abrir un correo nuevo en la ventana de Outlook.

Necesito rellenar de forma programada: de, a, asunto, información del cuerpo , pero deje esta nueva ventana de correo abierta para que el usuario pueda verificar el contenido / agregar algo y luego enviarlo como lo hace normalmente. Mensaje de Outlook.

Encontrado que:

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

Pero no hay una opción "De" (mis usuarios tienen más de un buzón ...)

¿Algún consejo (s)?


Esto es lo que he intentado. Está funcionando como se esperaba.

Esta aplicación agrega destinatarios, agrega cc y agrega sujeto y abre una nueva ventana de correo.

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Threading; using Outlook = Microsoft.Office.Interop.Outlook; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ButtonSendMail_Click(object sender, EventArgs e) { try { List<string> lstAllRecipients = new List<string>(); //Below is hardcoded - can be replaced with db data lstAllRecipients.Add("[email protected]"); lstAllRecipients.Add("[email protected]"); Outlook.Application outlookApp = new Outlook.Application(); Outlook._MailItem oMailItem = (Outlook._MailItem)outlookApp.CreateItem(Outlook.OlItemType.olMailItem); Outlook.Inspector oInspector = oMailItem.GetInspector; // Thread.Sleep(10000); // Recipient Outlook.Recipients oRecips = (Outlook.Recipients)oMailItem.Recipients; foreach (String recipient in lstAllRecipients) { Outlook.Recipient oRecip = (Outlook.Recipient)oRecips.Add(recipient); oRecip.Resolve(); } //Add CC Outlook.Recipient oCCRecip = oRecips.Add("[email protected]"); oCCRecip.Type = (int)Outlook.OlMailRecipientType.olCC; oCCRecip.Resolve(); //Add Subject oMailItem.Subject = "Test Mail"; // body, bcc etc... //Display the mailbox oMailItem.Display(true); } catch (Exception objEx) { Response.Write(objEx.ToString()); } } }


Finalmente resolví ese problema. Aquí hay una pieza de código que resuelve mi problema (con interpolaciones de Outlook de uso)

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 );


No puedes hacer esto con mailto. O bien su cliente tendrá que seleccionar la cuenta desde la que está enviando, que se predetermina a su cuenta predeterminada o tendrá que proporcionar un formulario de correo y configurar los encabezados cuando envíe el correo electrónico.