boa tarde.
fiz algumas alterações na função de envio de email, aparentemente funcionou,
se puder subir para o git
Function TMailUserControl.EnviaEmailTp(Nome, Login, USenha, Email,
Perfil: String; UCMSG: TUCMailMessage): Boolean;
var
MailMsg: TAlSmtpClient;
{$IF CompilerVersion >= 23}
MailRecipients: TALStringList;
MailHeader: TALEmailHeader;
{$ELSE}
MailRecipients : TStringlist;
MailHeader : TALSMTPClientHeader;
{$IFEND}
begin
Result := False;
if Trim(Email) = ” then
Exit;
MailMsg := TAlSmtpClient.Create;
{$IF CompilerVersion >= 23}
// MailMsg.OnStatus := OnStatus;
MailRecipients := TALStringList.Create;
MailHeader := TALEmailHeader.Create;
{$ELSE}
MailMsg := TAlSmtpClient.Create;
MailMsg.OnStatus := OnStatus;
MailRecipients := TStringlist.Create;
{$IFEND}
MailHeader.From := EmailRemetente;
MailHeader.SendTo := Email;
MailHeader.ContentType := ‘text/html’;
MailRecipients.Append(Email);
MailHeader.Subject := UCMSG.Titulo;
try
try
UCEMailForm := TUCEMailForm.Create(Self);
UCEMailForm.lbStatus.Caption := ”;
UCEMailForm.Show;
UCEMailForm.Update;
MailMsg.SendMail(ServidorSMTP, FPorta, EmailRemetente, MailRecipients,
Usuario, Senha, fAuthType, MailHeader.RawHeaderText,
ParseMailMSG(Nome, Login, USenha, Email, Perfil, UCMSG.Mensagem.Text));
UCEMailForm.Update;
Result := True;
except
on e: Exception do
begin
UCEMailForm.Close;
MessageDlg(e.Message, mtWarning, [mbok], 0);
raise;
end;
end;
finally
FreeAndNil(MailMsg);
FreeAndNil(MailHeader);
FreeAndNil(MailRecipients);
FreeAndNil(UCEMailForm);
end;
end;