Send email using NetOffice ASP MVC

1

I'm starting to send emails in my application, so I'm trying to use the package of NetOffice to send and receive emails. What I am trying to do is: From the account logged into the local pc with the Outlook application, I send an email with a pre-defined message in my application.

At the beginning I'm having problems ... I'm following a NetOffice example errors, where when importing the package ( using NetOffice; ), it gives errors starting Outlook ( Outlook.Application outlookApplication = new Outlook.Application(); ).

Another small question:  Are there any packages or better alternatives to NetOffice?

    
asked by anonymous 14.04.2014 / 17:28

1 answer

1

Download Package by Nuget from Visual Studio and bring your required dependencies to your project by following the steps below:

Menu: TOOLS - > Nuget Package Manager - > Manage Nuget Packages For Solution

Thenopenitwithsearch(netoffice.outlook): Obs: Choose the version corresponding to your Framework in my case was 4.5, the description already speaks for itself (2.0, 3.0 , 3.5, 4.0, and 4.5)

After successfully installing the encoding in your project would look like this:

NetOffice.OutlookApi._Application app = new NetOffice.OutlookApi._Application();            
app.Session.SendAndReceive(true);

A cool tip is to always use NuGet wherever possible because it resolves dependencies. A good read on the subject

a>, and this site.

    
14.04.2014 / 22:19