Click here to Skip to main content
15,889,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have to download attachments from specific mail id in outlook by passing username and password for that mail id. how can i do it?

i will run batch file which will then run the code every day to download attachments.

https://www.matthewproctor.com/extracting-attachments-from-outlook-using-c-sharp

got help from above one but its asking for password on server while running the code. and working fine in my local machine

What I have tried:

https://www.matthewproctor.com/extracting-attachments-from-outlook-using-c-sharp
Posted
Updated 6-Sep-16 1:44am
Comments
Philippe Mori 6-Sep-16 8:48am    
Write hyperlink as hyperlink if you want people to click on them. We don't have time to waste cutting and pasting URL of people to lazy to make hyperlinks.

1 solution

Outlook is a desktop application so your code must also be running on the desktop, so running under their account so you should have no problem?

The fact that you mention servers etc means you're not fully explaining your software architecture, but I can tell you now if you are using "servers" then your code isn't going to work. As said, Outlook is a desktop application, you can't automate it from a remote server, the code that iterates through the Outlook data store has to run on the client.

If you are using Exchange as your data store then use Exchange Web Services (google for more info).
 
Share this answer
 
Comments
Member 11094742 6-Sep-16 8:30am    
I have installed outlook on the machine which we are using as a server. but when i run the .exe on the machine it is asking me for password for mail id. even that outlook is configured with same email id
Philippe Mori 6-Sep-16 8:50am    
You should never install Outlook on a server. This is well known that Outlook is not designed for that purpose.
F-ES Sitecore 6-Sep-16 9:22am    
Outlook is a desktop app, if you install it on a server then it will show the email account for the user the server is logged in as. Outlook can't be configured to show details for users other than the current user, it just makes no sense.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900