This project is read-only.


Topics: Feature Requests, Help requests
Jun 9, 2015 at 11:13 PM
Hey I am trying to connect to server who uses 'STARTTLS' Capability. First I connect to server non SSL Port 143 then send command 'STARTTLS' and then 'LOGIN'. I get response after 'STARTTLS' as 'OK BEGIN TLS NEGOTATION NOW', but after I send 'LOGIN' I am not getting any response back. Can someone please help.
Jun 10, 2015 at 8:39 AM
Hi jabirst,
After the STARTTLS Command, you have to switch to an SslStream. I post the snipped here, that may help you.
IList<string> data=new List<string>();
if (SendAndReceive(ImapCommands.StartTLS, ref data))
    _ioStream = new SslStream(_client.GetStream(), false, CertificateValidationCallback, null);
    (_ioStream as SslStream).AuthenticateAsClient(_host, null, SslProtocols.Tls, false);
    _streamReader = new StreamReader(_ioStream);
    // update capabilities
I hope, this helps. Let me know, if you have further questions.

Best regards,
Jun 10, 2015 at 7:55 PM
Edited Jun 10, 2015 at 7:55 PM
Hi jabirst, Michael,

I will include Michael's snippet in the latest source code.


Jun 10, 2015 at 10:55 PM
Thanks it worked