Can You please Terll me How To read with IMAP.
Main Topics
Browse All TopicsI am Devloping an application in which I need to read the Mails form gmail Inbox of the client. I want To achieve the foolwing Points.
I don't want to use any Third Party Dll like (ASPosse or chilkat).
I want to use SMTP Preafably. or IMAP will do I don't want to use POP3
I am aware about reading unread mails from gmail Feeds Which I don't Want to use Due to These Problems:
Only unread mails can be read and that to max upto 20 mails.
the mail body is not included into the feed only summary is included.
In pop3 The problem is that it always stars to read from the First Mail Which I don't Want. I want to strart form the mail where I have Left.
I would Like use C# with ASP.NET to develope my code
I want to devlope code. not to use 3rd party dll
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Look at http://www.example-code.co
There is a lot of samples.
Sorry, wrong link. It is not free component.
Free one (and open source) you can download from http://www.codeproject.com
Yes I have Enabled IMAP in my gmail account. And I have no idea about this IMAP and Retriving mail. I just downlaoded the code from the link you provided and run the sample code it failed to login and then i tried by changing the port no to 993 which is used by outlok to interact with gmail and written in gmail docs. then it waits for so long time and no response came.
Great... so you have to begin with IMAP basics... http://tools.ietf.org/html
Look at http://www.openssl.org/ for SSL/TLS handling...
I don't know what to get from the above link you gave to me. what encryption needs to do here I simply need to read the gmail inbox. I have done it by using pop3 the only problem is it reads from the last mail in the inbox not from the lattest one. and i just want to fecth the unread mails. what can I do.
Gmail supports encryption and ssl
even when i used pop3 then also ssl was set to true without this we can't interact with gmail inbox
here is the code I used with pop3 it works then why can't with IMAP
try
{
TcpClient tcpclient = new TcpClient(); // create an instance of TcpClient
tcpclient.Connect("pop.gma
System.Net.Security.SslStr
sslstream.AuthenticateAsCl
//bool flag = sslstream.IsAuthenticated;
System.IO.StreamWriter sw = new StreamWriter(sslstream); // Asssigned the writer to stream
System.IO.StreamReader reader = new StreamReader(sslstream); // Assigned reader to stream
sw.WriteLine("USER "+ txtUserNAme.Text); // refer POP rfc command, there very few around 6-9 command
sw.Flush(); // sent to server
sw.WriteLine("PASS "+txtPass.Text);
sw.Flush();
sw.WriteLine("RETR 1"); // this will retrive your first email
sw.Flush();
sw.WriteLine("Quit "); // close the connection
sw.Flush();
string str = string.Empty;
string strTemp = string.Empty;
while ((strTemp = reader.ReadLine()) != null)
{
if (strTemp == ".") // find the . character in line
{
break;
}
if (strTemp.IndexOf("-ERR") != -1)
{
break;
}
str += strTemp;
}
Response.Write(str);
Response.Write("<BR>" + "Congratulation.. ....!!! You read your first gmail email ");
If it can't then please suggest me which componet will be better to purchase?
you have:
sw.WriteLine("USER "+ txtUserNAme.Text);
sw.Flush(); // sent to server
sw.WriteLine("PASS "+txtPass.Text);
sw.Flush();
sw.WriteLine("RETR 1"); // this will retrive your first email
sw.Flush();
sw.WriteLine("Quit "); // close the connection
for USER, PASS, RETR and QUIT command
Connect to 995 to imap.gmail.com and issue LOGIN, SELECT, LIST and CLOSE as described in RFC3501.
Thanks for your time I got the solution from pop server only here is the link:
http://www.codeprojec
Business Accounts
Answer for Membership
by: gtworekPosted on 2009-08-24 at 02:08:26ID: 25166587
SMTP is for SENDING only. You may read mail using IMAP or POP3.