Advertisement
Guest User

Source android

a guest
Oct 2nd, 2013
612
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. unit sobre2;
  2.  
  3. interface
  4.  
  5. uses
  6. System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  7. FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
  8. IdMessage, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  9. IdExplicitTLSClientServerBase, IdMessageClient, IdSMTPBase, IdSMTP;
  10.  
  11. type
  12. TForm1 = class(TForm)
  13. IdSMTP1: TIdSMTP;
  14. IdMessage1: TIdMessage;
  15. Button1: TButton;
  16. procedure Button1Click(Sender: TObject);
  17. private
  18. { Private declarations }
  19. public
  20. { Public declarations }
  21. end;
  22.  
  23. var
  24. Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.fmx}
  29.  
  30. procedure TForm1.Button1Click(Sender: TObject);
  31. begin
  32. IdSMTP1.Heloname:='test';
  33. IdSMTP1.Host:='smtp.gmail.com';
  34. IdSMTP1.Username:='[email protected]';
  35. IdSMTP1.Port:=465;
  36. IdSMTP1.Password:='password';
  37.  
  38.  
  39. if IdSMTP1.Connected=True then IdSMTP1.Disconnect;
  40. IdMessage1.Clear;
  41. IdMessage1.From.Address := 'xpto';
  42. IdMessage1.Recipients.Add;
  43. IdMessage1.Recipients.Items[0].Address := '[email protected]';
  44. IdMessage1.Priority := mpHigh;
  45. IdMessage1.Sender.Address:='[email protected]';
  46. IdMessage1.Subject := 'Subject';
  47. IdMessage1.Body.Add('test');
  48. IdSMTP1.Connect;
  49. IdSMTP1.Send(IdMessage1);
  50. end;
  51.  
  52. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement