Aspose.Email and Microsoft Outlook

Hi,

I'm new in Aspose.Email.

I 'm developing a Windows form application (vb.net). I need to "interface" my application with Microsoft Outlook, in particolary I need to create a new Outlook message with some informations already filled: From, To, Subject, some attached files, .... then, user will write email body and then he will send the message.

Is it possible to do it using Aspose.Email ?

regards

Stefano

Hi Stefano,

Thank you for using Aspose.Email.

Could you please elaborate your statement “Interface with Microsoft Outlook”? I would like to share that Aspose.Email for .NET is an API that does not depend on Microsoft Outlook for its functionality and your requirements can be met without the need of using Microsoft Outlook.

The API’s MailMessage class allows you to compose a new message and specify its properties like From, To, Subject, Body, etc. as well as add attachments to the message. Once all the required parameters are specified, you can use the SmtpClient class to send the email; all without using Microsoft Outlook. Please refer to our documentation section “Sending Email Messages with Smtp” for sample code in this regard.

Your elaboration about your requirements will help us assist you further in this regard.

Hi, thank you for reply,

just a sample:

I click a button on my windows form and I have to show the "session/windows" as I click New Message in Outlook, with some fileds filled (From, To, subject,...).

See attached image.

Regards

Stefano

Hi Stefano,


It is possible to create a message in draft mode using Aspose.Email, sve it on disc and then open it in Outlook directly from the c# application. Following sample code demonstrates this feature:

MailMessage message = new MailMessage("test1@test1.com", "test2@test2.onmicrosoft.com", “Test Subject”, “Test Body”);

//It will mark message as UNSENT

message.Headers.Add(“X-Unsent”, “1”);

message.Save(“Test2.msg”,MailMessageSaveType.OutlookMessageFormatUnicode);

message.Dispose();

Process.Start(“Outlook.exe”, “/f “Test2.msg””);

Please feel free to write us back if you have any other query related to Aspose.Email.

Thanks,

this is a good solution. Is it possible to attach a file (message object)?

Hi Stefano,

Thank you for providing the feedback.

The MailMessage class allows you to add an attachment of any type to the message. Please have a look at the following code sample for your kind reference and let us know if we can be of any additional help to you in this regard.

Sample Code:

MailMessage msg = new MailMessage();
msg.Attachments.Add(new Attachment("DwnloadedMsg.msg"));
msg.Save("MsgWithAt.msg", MailMessageSaveType.OutlookMessageFormatUnicode);

Hi,

many thanks for reply and for the solution. I think I will use it !

Regards

Stefano