Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
33
Task/Send-email/Delphi/send-email.delphi
Normal file
33
Task/Send-email/Delphi/send-email.delphi
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
procedure SendEmail;
|
||||
var
|
||||
msg: TIdMessage;
|
||||
smtp: TIdSMTP;
|
||||
begin
|
||||
smtp := TIdSMTP.Create;
|
||||
try
|
||||
smtp.Host := 'smtp.server.com';
|
||||
smtp.Port := 587;
|
||||
smtp.Username := 'login';
|
||||
smtp.Password := 'password';
|
||||
smtp.AuthType := satNone;
|
||||
smtp.Connect;
|
||||
msg := TIdMessage.Create(nil);
|
||||
try
|
||||
with msg.Recipients.Add do begin
|
||||
Address := 'doug@gmail.com';
|
||||
Name := 'Doug';
|
||||
end;
|
||||
with msg.Sender do begin
|
||||
Address := 'fred@server.com';
|
||||
Name := 'Fred';
|
||||
end;
|
||||
msg.Subject := 'subj';
|
||||
msg.Body.Text := 'here goes email message';
|
||||
smtp.Send(msg);
|
||||
finally
|
||||
msg.Free;
|
||||
end;
|
||||
finally
|
||||
smtp.Free;
|
||||
end;
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue