INetSmtpClient.EnableSsl

Fore 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:

Fore 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 NetMailAddress.Create("ivanov@server.ru");
    To_ := New NetMailAddress.Create("petrov@mail.ru");
    Message := New NetMailMessage.CreateWithFromAndTo(From_, To_);
    Message.Subject := "Test message";
    Message.Body := "Message text";
    Client := New NetSmtpClient.CreateWithHost("example.server.ru");
    Credential := New NetNetworkCredential.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