Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Nova implementação para envio de e-mail #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

imozart
Copy link
Contributor

@imozart imozart commented Nov 18, 2020

  • Nova implementação para envio de e-mail com Delphi
  • Novo README.md para framework Mail
  • Testes unitários para envio de email

Adiciona a interface Mail para envio de emails.
Adiciona MailBase para implementação do envio de email
Adiciona um README.md para o framework Mail a fim de explicar o funcionamento
Framework para envio de email + README.md + testes unitários
@imozart imozart requested a review from andrepg November 18, 2020 01:37
begin
for i := 0 to Pred(GetCcRecipients.Count) do
begin
with AMsg.CCList.Add do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vamos usar o with mesmo? Não vale a pena evitar não?

body := TIdText.Create(AMsg.MessageParts);
body.Body.Text := GetMessages.Text;
body.ContentType := 'text/plain';
if IsWithHTML then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talvez trocar a variável por HaveHtmlContent, ou IsHtmlFormat. Ficou meio vago esse nome.

Comment on lines +177 to +185
try
if IsWithAuthentication then
begin
smtp.Authenticate;
end;
smtp.Send(msg);
finally
smtp.Disconnect;
end;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acredito que aqui a gente pode mesclar os dois Try..Finally, e eliminar esse interno, levando o SMTP.Disconnect pra dentro do Finally abaixo.

Comment on lines +37 to +39
function IsWithSSL: Boolean;
function IsWithTLS: Boolean;
function IsWithAuthentication: Boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No caso das variáveis IsWithConfirmation, IsWithAuthentication, IsWithSSL e IsWithTLS acho que podemos tirar o Is, porque fica redundante.

function GetAttachments: TStringList;
function GetSubject: string;
function GetMessages: TStringList;
function IsWithHTML: Boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talvez trocar a variável por HaveHtmlContent, ou IsHtmlFormat. Ficou meio vago esse nome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants