Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit sobre2;
- interface
- uses
- System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
- FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
- IdMessage, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
- IdExplicitTLSClientServerBase, IdMessageClient, IdSMTPBase, IdSMTP;
- type
- TForm1 = class(TForm)
- IdSMTP1: TIdSMTP;
- IdMessage1: TIdMessage;
- Button1: TButton;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.fmx}
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- IdSMTP1.Heloname:='test';
- IdSMTP1.Host:='smtp.gmail.com';
- IdSMTP1.Username:='[email protected]';
- IdSMTP1.Port:=465;
- IdSMTP1.Password:='password';
- if IdSMTP1.Connected=True then IdSMTP1.Disconnect;
- IdMessage1.Clear;
- IdMessage1.From.Address := 'xpto';
- IdMessage1.Recipients.Add;
- IdMessage1.Recipients.Items[0].Address := '[email protected]';
- IdMessage1.Priority := mpHigh;
- IdMessage1.Sender.Address:='[email protected]';
- IdMessage1.Subject := 'Subject';
- IdMessage1.Body.Add('test');
- IdSMTP1.Connect;
- IdSMTP1.Send(IdMessage1);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement