+3 votes

My problem is the Smtp.Login command

when I try to login, the server says:

Must issue a STARTTLS command first

I can I solve it?

by
retagged by

1 Answer

0 votes

Use Smtp.StartTLS method:

smtp.Connect("server.example.com");
smtp.StartTLS();
smtp.UseBestLogin("user", "password");

There are two modes in which Mail.dll can work:

  • Implicit – where Mail.dll SMTP client immediately connects using secure channel,
  • Explicit – where Mail.dll SMTP client connects using unsecured channel first and then secures the communication by issuing STARTTLS command. This mode is sometimes called TLS.

Click her for more details on using SSL/TLS with SMTP protocol.

Here you can find more information on SSL vs TLS vs STARTTLS

by (297k points)
...