0

I'm wondering is there any solution to get current users email and password from outlook with C# ? I need those information to send e-mail from desktop app for log.

Martha
  • 3,932
  • 3
  • 33
  • 42
Eren Yatkin
  • 186
  • 2
  • 9
  • 2
    There is no way to get a users password, allowing that would be a huge security hole in any system. – DavidG Jun 28 '16 at 11:00
  • only what you can - open send message diaalog for current user. – tym32167 Jun 28 '16 at 11:00
  • Outlook doesn't store that data, you need to get it from Active Directory. And as @DavidG said, you can't get the password, just the email – Oscar Jun 28 '16 at 11:01
  • Okay I get it. Well how can I send email from current outlook account via my app ? Let's say I got the account's e-mail address from outlook. I mean I need to send e-mail from current user's e- mail. – Eren Yatkin Jun 28 '16 at 11:06

1 Answers1

0

Since you have tagged ASP-Classic, I guess you are trying implement this in classic ASP. I would suggest you to create a new aspx page or a handler (ashx) in .Net. Then you can implement your email functionality in that class using Microsoft.Office.Interop.Outlook. Refer- https://msdn.microsoft.com/en-us/library/office/bb644320.aspx?f=255&MSPPError=-2147217396 and Sending Email through Outlook 2010 via C# Please note- You need to use an existing Windows account which can send and receive mails.

Community
  • 1
  • 1
Souvik Ghosh
  • 4,456
  • 13
  • 56
  • 78
  • Thanks, second url is the solution for me. Also I found this : https://msdn.microsoft.com/en-us/library/office/ff462091.aspx . It might help someone. – Eren Yatkin Jun 28 '16 at 11:15
  • What on earth does this answer have to do with classic ASP? How does "create a new aspx page" qualify as classic ASP? – Martha Jun 28 '16 at 15:18
  • @Martha Based on my experience, I found it was easier to create a handler or an aspx page to handle some of the common .Net related stuffs like this. It gave me more control. Anyway, it is developers choice. Sorry for any confusion. – Souvik Ghosh Jun 29 '16 at 07:46
  • @SouvikGhosh: I still don't get it. Classic ASP and dot-net are mutually exclusive. If you have to deal with "common .Net related stuff", then you can't possibly be using classic ASP. At least in *my* universe. – Martha Jun 29 '16 at 14:02
  • @Martha I am not pointing the differences between Classic ASP and .Net. People are well aware of that. I have only answered the question with suggestion which the user has accepted. – Souvik Ghosh Jun 30 '16 at 06:14