CreateWithHost(Host: String);
Host - mail server name or IP address.
The CreateWithHost constructor creates an object that provides for email message sending.
The name or the IP address of the mail server, via which messages are sent, is passed by the Host parameter.
Sub SendMailMessage(Server: String);
Var
From_, To_: INetMailAddress;
Message: INetMailMessage;
Client: INetSmtpClient;
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");
Client.Send(Message);
End Sub SendMailMessage;
This procedure can be used for sending email messages via the specified mail server. The name or the IP address of the mail server is specified in the Server procedure parameter.
See also: