DICAS

Visite a biblioteca de dicas da comunidade.

Saiba mais

ARTIGOS

Abordagens detalhadas sobre assuntos diversos.

Saiba mais

INICIANTES

Aprenda a programar de um modo simples e fácil.

Saiba mais

DOWNLOADS

Acesse os materiais exclusivos aos membros.

Saiba mais
voltar

Emerson

Respostas no Fórum

Visualizando 2 posts - 1 até 2 (de 2 do total)
  • Autor
    Posts
  • em resposta a: erro no envio de email #2193
    Emerson
    Participante

    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;

    em resposta a: erro no envio de email #2192
    Emerson
    Participante

    Estou com o mesmo problema…
    o erro ocorre mais precisamente na unit ucmail

    na função add na linha do getcount

    function TALStrings.Add(const S: AnsiString): Integer;
    begin
    Result := GetCount; //erro aqui
    Insert(Result, S);
    end;

    Usando Delphi Berlin update 2

Visualizando 2 posts - 1 até 2 (de 2 do total)

Ir ao topo
© 2024 Infus Soluções em Tecnologia - Todos os Direitos Reservados