+1 vote

I was testing your dll and gone into below error

Additional information: Invalid sequence of commands (AUTH SSL/TLS required prior to authentication).

by
retagged by
Are you using IMAP, POP3 or SMTP or FTP? How does your code look like?

1 Answer

0 votes

In case of FTP this error means that you need to issue AUTH TLS command method to enable TLS/SSL for both data and control channel.

Use AuthTLS() method after Connect to do that:

using (Ftp ftp= new Ftp())
{
    ftp.Connect("ftp.example.org");

    ftp.AuthTLS();

    ftp.Login("username", "password");

    foreach (FtpItem item in ftp.GetList())
    {
        if (item.IsFolder == true)
            Console.WriteLine("[{0}]", item.Name);
        else
            Console.WriteLine("{0}", item.Name);
    }
    ftp.Close();
}

You can find more details here:
Use SSL with FTP (Explicit)
Use SSL with FTP (FTPS)

In case of email protocols, this error means that you need to issue STARTTLS or STLS command (SSL vs TLS vs STARTTLS).

Use StartTLS() method after Connect to do that:

using (Smtp smtp = new Smtp())
{
    smtp.Connect("smtp.example.com");
    smtp.StartTLS();

    smtp.UseBestLogin("user", "password");

    // ...

    smtop.Close();
}
by (297k points)
edited by
...