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

by
reshown by

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

by (297k points)
...