locked
I have written a function which uses "Microsoft.Office.Interop.Outlook" to populate CC mails, which works on Local System, the problem is I have deployed the application on server,and it gives error RRS feed

  • Question

  • User-1149305722 posted

    I have an application to populate the mail with cc emails, and display it, now this thing works fine on the local system and when i deployed it on server, this gave me error and it doesnt work as intended, the web application is used by several other users on different systems, but now the thing is that it gives error when time to connect to ol = new Microsoft.Office.Interop.Outlook.Application(); it doesnt create the application 

    the outlook is set up on users system and its working , but on the system where the app is deployed there is no outlook installed. 

    my concern is that it searches the CLSID of the outlook where it is deployed and not of the users system on which the web app is currently being used

    can anyone help? any help would be appriciated

    any solution for this 

    Monday, June 24, 2019 6:30 AM

All replies

  • User541108374 posted

    Hi,

    and welcome to the ASP.NET forums.

    The interop way is likely not the best way to go. Rather make use of the .NET framework possibilities to send emails. Take a look at the samples: http://www.systemnetmail.com/faq/3.aspx.

    Kris.

    Monday, June 24, 2019 6:58 AM
  • User-1149305722 posted

    thank you so much 

    My application just wants to open the "Outlook" mail window on clients machine with populated CC emails, which doesnt open the mail window on clients machine

    is it possible to open the outlook window on clients machine using  System.Net.Mail ?

    Monday, June 24, 2019 7:01 AM
  • User753101303 posted

    Hi,

    Your code won't work as it runs on the web server. System.Net.Mail sends directly a mail to the server.

    If you really need to launch a mail client and let the user then do whatever he wants you could try https://en.wikipedia.org/wiki/Mailto

    Monday, June 24, 2019 7:42 AM
  • User-1149305722 posted

    so basically it means that it will open any default client not specifically Outlook ? since i want only outlook to open on all client system whichever is using the application

    mailto : will open any default client correct ?>

    any other way to get through this ?

    Monday, June 24, 2019 8:07 AM
  • User753101303 posted

    Correct. You usually don't have this level of control from a web app.

    Do you have full control on machines used to browse this site ? You could then have a company policy to enforce Outlook as the default mail program rather than Mail. If not under your control, users are kept in control free to use what they want....

    IMHO it's best to avoid imposing too much...

    Monday, June 24, 2019 8:25 AM
  • User665608656 posted

    Hi centigoa,

    According to your issue, the key to your issue is the "Microsoft.Office.Interop.Outlook" library you quoted.

    This library involves a lot of complex problems that make it impossible to open outlook on the server side, 

    When you use this library on the server side, you need to add this reference to the web.config's Assembly, and then you will have to deal with complex issues such as privileges.

    So we don't recommend that you use Microsoft.Office Interop.Outlook library to complete your functions.

    Based on your description, you can try to use server-side code to achieve the function of sending mail, just like the system.Net.Mail technology mentioned by other replyers.

    If you want users to customize the content of sending mail, you can add textboxes to the page, and let users customize some parameters of sending mail, so as to realize the automation of sending mail.

    Best Regards,

    YongQing.

    Tuesday, June 25, 2019 8:16 AM
  • User-1149305722 posted

    Thank you for help :)

    Tuesday, June 25, 2019 8:57 AM