.Net IMAP client

.Net IMAP client

am 22.01.2008 15:43:42 von Olga

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