Skip to content

Commit

Permalink
Update Mail4Delphi.pas
Browse files Browse the repository at this point in the history
  • Loading branch information
juliosenha committed Nov 20, 2020
1 parent 9e2de34 commit 40a0dba
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Mail4Delphi.pas
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,19 @@ function TMail.Connect: Boolean;
FIdMessage.ReceiptRecipient.Text := FIdMessage.From.Name + ' ' + FIdMessage.From.Address;
try
FIdSMTP.Connect;
except
on E: Exception do
raise Exception.Create('Erro na conexão: ' + E.Message);
end;
try
FIdSMTP.Authenticate;
Result := True;
except
on E: Exception do
raise Exception.Create('Erro na conexão ou autenticação: ' + E.Message);
begin
Self.Disconnect;
raise Exception.Create('Erro na autenticação: ' + E.Message);
end;
end;
end;

Expand Down

0 comments on commit 40a0dba

Please sign in to comment.