0

I want to add outlook functionality in My project.

In that now I used Outlook.Application() so it took mail id from desktop outlook application which is available in system.

But I want pass the mail id and password from user enter on web without Outlook.Application.

For that what can I do?

EAmez
  • 837
  • 1
  • 9
  • 25
  • exactly what kind of functionality do you want to add? Bear in mind that Outlook is a desktop application, and you are implementing a web application. So the two cannot talk to each other directly - a browser-based application does not have access to other applications on the user's device, for security reasons. – ADyson Jul 15 '19 at 09:59
  • Why do you think you need the user's mail ID and password exactly? What information do you want? If you just want to send emails on their behalf, send an email directly to the email server via SMTP, with their email address in the "from" field (you can get their email address from their Active Directory record) – ADyson Jul 15 '19 at 10:00
  • in my web application i need outlook authentication and it need it to continue in my application as user login after that i created some rule and my functionality. i want it like web add-ins concept. – Dipak Madan Jul 15 '19 at 10:15
  • so you want your application to be able to create a Rule in the user's mailbox, is that right? I'm pretty sure this can be done server-side by talking to the Exchange Server, rather than the Outlook desktop application. In a server-side web application, that should be the solution you're looking at, not trying to interact with the desktop. You can connect to the Exchange server using an account which has enough privileges to modify rules on anyone's account, you don't need the user's specific credentials. – ADyson Jul 15 '19 at 10:19
  • what version of Exchange Server are you using? – ADyson Jul 15 '19 at 10:22
  • i didn't used the exchange server i used public string getemail() { Outlook.Application app = new Outlook.Application(); Outlook.Accounts accnts = app.Session.Accounts; string outemail = ""; foreach (Outlook.Account acc in accnts) { objLog.WriteLog("Login - Account Found - " + acc.SmtpAddress.ToString()); outemail = acc.SmtpAddress.Trim().ToLower(); break; } return outemail; } – Dipak Madan Jul 15 '19 at 10:36
  • it get a mail id from Desktop outlook but in my application i want it on it web browser. – Dipak Madan Jul 15 '19 at 10:39
  • I know you didn't use the Exchange server, but I'm saying that in a web application context that's what you _need_ to be doing. A web application cannot interact with the user's desktop Outlook client. The .NET code runs on the server, so it has no access to the Outlook client, and any JavaScript code running in the browser in the user's machine does not have access to Outlook either, for security reasons (so that some random website cannot start reading your mail, for example!). Now you understand these facts, you'll hopefully see why you need to do this task via the Exchange server instead. – ADyson Jul 15 '19 at 10:44
  • Now depending on what version of Exchange server you're using, there may be slightly different ways to accomplish the task (e.g. you may be able to use [Exchange Web Services](https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-manage-inbox-rules-by-using-ews-in-exchange) which is probably the best solution) – ADyson Jul 15 '19 at 10:50

0 Answers0