By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,167 Members | 1,190 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,167 IT Pros & Developers. It's quick & easy.

.Net IMAP client

P: n/a
I have to make some investigation about possibility to develop IMAP/SSL

Can somebody help me with the understanding how SSL will work?
Now I have the simple example to establish the connection with the IMAP
TcpClient ImapServer = new TcpClient(Hostname, Port);

NetworkStream ImapNetStream = ImapServer .GetStream();

ImapNetStream.ReadTimeout = 10000;

StreamReader ImapStrReader = new StreamReader(ImapNetStream );

string Resp = ImapStrReader .ReadLine();

Please help me what to be changed to use SSL? I've tried to use SslStream
instead of the NetworkStream (like I've made a POP3/SSL connection):

TcpClient ImapServer = new TcpClient(Hostname, Port);

Stream ImapNetStream = new SslStream(ImapServer.GetStream(), false);

ImapNetStream ReadTimeout = 10000;

((SslStream)ImapNetStream ).AuthenticateAsClient(Hostname);

StreamReader ImapStrReader =new StreamReader(ImapNetStream );

string Resp = ImapStrReader .ReadLine();

but not succeded. I've tried to connect to my gmail account using IMAP. I\ve
got failed to connect exception :( the hostname and port values are

WBW, Olga
Jan 22 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.