Advertisement
Guest User

Untitled

a guest
May 5th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. procedure TForm1.WorkIt(Sender: TObject);
  2. var logfile: TStringList;
  3. i: Integer;
  4.  
  5. begin
  6. IdSMTP1 := TIdSMTP.Create(nil);
  7. IdMessage1 := TIdMessage.Create(nil);
  8. Screen.Cursor := crHourGlass;
  9. RichEdit2.Text:=RichEdit1.Text;
  10. try
  11. IdSMTP1.HeloName := 'blabla';
  12. IdSMTP1.Host := Form3.Edit1.Text;
  13. IdSMTP1.Username := Form3.Edit4.Text;
  14. IdSMTP1.Password := Form3.Edit5.Text;
  15. IdSMTP1.Port := StrToInt(Form3.Edit2.Text);
  16. IdSMTP1.AuthenticationType:=atLogin;
  17. IdSMTP1.Connect;
  18. IdMessage1.From.Address := 'blabla';
  19. IdMessage1.Recipients.EMailAddresses := StatusBar1.Panels[1].Text;
  20. IdMessage1.ReceiptRecipient.Address := 'blabla';
  21. IdMessage1.Subject := Form3.Edit6.Text;
  22. for i:=0 to RichEdit1.Lines.Count-1 do
  23. begin
  24. IdMessage1.Body.Add(RichEdit2.Lines.Strings[i]);
  25. end;
  26. IdSMTP1.Send(IdMessage1);
  27. finally
  28. FreeAndNil(IdSMTP1);
  29. FreeAndNil(IdMessage1);
  30. Screen.Cursor := crDefault;
  31. end;
  32. end;
  33. end;
  34. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement