467,918 Members | 1,240 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,918 developers. It's quick & easy.

.Net IMAP client

Hi!
I have to make some investigation about possibility to develop IMAP/SSL
client.

Can somebody help me with the understanding how SSL will work?
Now I have the simple example to establish the connection with the IMAP
server:
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
correct.....

WBW, Olga
Jan 22 '08 #1
  • viewed: 1300
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Marko | last post: by
1 post views Thread by vardhansasi | last post: by
1 post views Thread by Fabian MŁller | last post: by
6 posts views Thread by Grant Edwards | last post: by
2 posts views Thread by comp.lang.php | last post: by
5 posts views Thread by kapila Wijethilaka | last post: by
2 posts views Thread by J Huntley Palmer | last post: by
1 post views Thread by buddi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.