procedure TForm1.Button1Click(Sender: TObject);
begin
NMSMTP1.Host := "mail.host.com";
NMSMTP1.UserID := "Username";
NMSMTP1.Connect;
NMSMTP1.PostMessage.FromAddress := "your_mail@host.com";
NMSMTP1.PostMessage.ToAddress.Text := "delphiworld@mail.ru";
NMSMTP1.PostMessage.ToCarbonCopy.Text := "your_mail@host.com";
NMSMTP1.PostMessage.ToBlindCarbonCopy.Text := "second_your_mail@host.com";
NMSMTP1.PostMessage.Body.Text := "This is the message from Delphi World project";
NMSMTP1.PostMessage.Attachments.Text := "c:\File.txt";
NMSMTP1.PostMessage.Subject := "Delphi World is Great!";
NMSMTP1.SendMail;
ShowMessage("Mail sent !");
NMSMTP1.Disconnect;
end;
|