Last post Jun 25, 2019 08:57 AM by certigoa
Jun 24, 2019 06:30 AM|certigoa|LINK
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
Jun 24, 2019 06:58 AM|XIII|LINK
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.
Jun 24, 2019 07:01 AM|certigoa|LINK
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 ?
Jun 24, 2019 07:42 AM|PatriceSc|LINK
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
Jun 24, 2019 08:07 AM|certigoa|LINK
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 ?
Jun 24, 2019 08:25 AM|PatriceSc|LINK
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...
Jun 25, 2019 08:16 AM|Yongqing Yu|LINK
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.
Jun 25, 2019 08:57 AM|certigoa|LINK
Thank you for help :)