INetSmtpClient.EnableSsl

Syntax

EnableSsl: Boolean;

Description

The EnableSsl property determines whether SSL encryption is required to send messages via external mail servers.

Comments

Use the INetSmtpClient.Port property to determine the port, via which emails are sent.

Available values:

Example

To execute the example, add a link to the Net system assembly.

Sub UserProc;
Var
    From_, To_: INetMailAddress;
    Message: INetMailMessage;
    Client: INetSmtpClient;
    Credential: INetNetworkCredential;
Begin
    From_ := New CurlMailAddress.Create("ivanov@server.ru");
    To_ := New CurlMailAddress.Create("petrov@mail.ru");
    Message := New CurlMailMessage.CreateWithFromAndTo(From_, To_);
    Message.Subject := "Test message";
    Message.Body := "Message text";
    Client := New CurlSmtpClient.CreateWithHost("example.server.ru");
    Credential := New CurlNetworkCredential.Create("user""password""work");
    Client.ThisHostCredentials("") := Credential;
    Client.EnableSsl := True;
    Client.Send(Message);
End Sub UserProc;

The specified procedure enables the user to send emails via the specified mail server. The specified credentials are used for authorization at the mail server.

See also:

INetSmtpClient