Отправить E-mail

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 := ‘Kvrsoft@mail.ru’;

NMSMTP1.PostMessage.ToCarbonCopy.Text := ‘your_mail@host.com’;

NMSMTP1.PostMessage.ToBlindCarbonCopy.Text := ‘second_your_mail@host.com’;

NMSMTP1.PostMessage.Body.Text := ‘HI’;

NMSMTP1.PostMessage.Attachments.Text := ‘c:\File.txt’;

NMSMTP1.PostMessage.Subject := ‘Delphi World is Great!’;

NMSMTP1.SendMail;

ShowMessage(‘Mail sent !’);

NMSMTP1.Disconnect;

end;

Добавить комментарий