Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hello everyon,
My questions are as follows:
1)How to authorized use Gmail API to account in asp.net?
2)How to use Gmail api get Inbox lists and sent mail in asp.net?

Please provide any relevant sample code.

Thanks in advance.
Posted

Sadly there is no official ASP.NET document or a sample project for downloading the emails from the email server; such as Gmail or Outlook. They just created a helper class WebMail for sending the emails through any SMTP server; including Gmail.

Anyways, you can try using these settings from this web page[^] (Google Help) and then try creating a WebClient and pass these settings while downloading the streams from the Gmail servers. Hopefully that would do the job for your project. I am also unaware of any ASP.NET sample IMAP client that I might share here for you. But since ASP.NET runs over .NET, you might want to use these libraries in the backend and show their responses in the HTML format in ASP.NET.

http://stackoverflow.com/a/1524173/1762944[^]

https://www.nuget.org/packages/S22.Imap/[^]
 
Share this answer
 
Comments
Ken H123 29-Jan-15 20:18pm    
Thank for your answer.
IMAP is just IMAP. Libraries like this: IMAP and POP3 Clients in C#[^] (or others you might find) can help you for sure. If you have the username and password, you can simply connect to gmail also as it is free to connect to it.
On the other hand if you wnat to provide this as a service for third parties, you need to take care about serious security considerations regarding your own application.

You can look at the source of any open source asp.net webmail application to see how they have implemented it. Here are some:
http://www.afterlogic.org/webmail-lite-net[^]
http://anmar.eu.org/projects/sharpwebmail/[^]
 
Share this answer
 
Comments
Ken H123 29-Jan-15 20:18pm    
Thank for your answer.

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