"Unkown command" while using imap.StartTLS()

0 votes
imap.Connect(txtmailIncMailSrver.Text.Trim());
imap.StartTLS();

after excecuting the imap.StartTLS(), it throws an error like unknown command

Please provide me solution

asked Oct 24, 2018 by siva
reshown Oct 24, 2018 by Limilabs support

1 Answer

0 votes

It looks like your server is not supporting STARTTLS command (explicit SSL/TLS mode, where you first connect on plain text port and then secure the connection).

Consider using ConnectSSL instead:

imap.ConnectSSL("imap.example.com");
imap.UseBestLogin("user", "pass");

You can find more details on how to use SSL/TLS and IMAP here:
https://www.limilabs.com/blog/use-ssl-with-imap

answered Nov 1, 2018 by Limilabs support (224,080 points)
...