Enviar e-mail no Windows Live

Discussão em 'Progress 4GL' iniciado por Uziel Guimaraes, Novembro 4, 2011.

  1. Uziel Guimaraes

    Uziel Guimaraes Sem Pontuação

    Como faço para enviar e-mail por dentro de um programa Progress sem utilizar API num equipamento rodando Windows 7 ?
    Estou com esse problema após trocar de sistema operacional, de XP para o Windows 7! O utilitario padrão para tratamento de e-mail's, nesta nova versão do SO deixou de ser o Outlook para ser o Windows Live. Nos meus programas, eu utilizo o mail-send(RUN mail-send) para enviar e-mail por dentro do programa, mas agora, com o Windows Live, o SO até me pede autorização para enviar o e-mail, mas de fato ele não o faz.
  2. LeandroSantos

    LeandroSantos Membro Participativo

    Eu utilizo xpMail.dll para enviar de emails.
    Tenho varios clientes de email(microsoft outlook, outlook express, windows mail, window live mail) e funciona com todos eles.

    Voce pode baixar aqui: http://www.4gl.fr/download.htm
  3. baltazar

    baltazar Membro Participativo

    Podia enviar um exemplo?
  4. Uziel Guimaraes

    Uziel Guimaraes Sem Pontuação

    Caro Leandro,
    Muito Obrigado pela dica, vou testar agora....
  5. Uziel Guimaraes

    Uziel Guimaraes Sem Pontuação

    Caro Baltazar,
    Primeiramente baixe o utilitario de: http://www.4gl.fr/download.htm. depois dispare o .exe, ao final ele te dá a opção de acesso ao documento com informações sobre a utilização desse utilitario, inclusive com exemplo em 4GL.
  6. LeandroSantos

    LeandroSantos Membro Participativo

    Código:
    def var retorno as int.
    
    function emailerro return char.
       case retorno:
          when  0 then return "OK".
          when  1 then return "MAPI_USER_ABORT (1)".
          when  2 then return "MAPI_E_FAILURE (2)".
          when  3 then return "MAPI_E_LOGIN_FAILURE (3)".
          when  4 then return "MAPI_E_DISK_FULL (4)".
          when  5 then return "MAPI_E_INSUFFICIENT_MEMORY (5)".
          when  6 then return "MAPI_E_ACCESS_DENIED (6)".
          when  8 then return "MAPI_E_TOO_MANY_SESSIONS (8)".
          when  9 then return "MAPI_E_TOO_MANY_FILES (9)".
          when 10 then return "MAPI_E_TOO_MANY_RECIPIENTS (10)".
          when 11 then return "MAPI_E_ATTACHMENT_NOT_FOUND (11)".
          when 12 then return "MAPI_E_ATTACHMENT_OPEN_FAILURE (12)".
          when 13 then return "MAPI_E_ATTACHMENT_WRITE_FAILURE (13)".
          when 14 then return "MAPI_E_UNKNOWN_RECIPIENT (14)".
          when 15 then return "MAPI_E_BAD_RECIPTYPE (15)".
          when 16 then return "MAPI_E_NO_MESSAGES (16)".
          when 17 then return "MAPI_E_INVALID_MESSAGE (17)".
          when 18 then return "MAPI_E_TEXT_TOO_LARGE (18)".
          when 19 then return "MAPI_E_INVALID_SESSION (19)".
          when 20 then return "MAPI_E_TYPE_NOT_SUPPORTED (20)".
          when 21 then return "MAPI_E_AMBIGUOUS_RECIPIENT (21)".
          when 22 then return "MAPI_E_MESSAGE_IN_USE (22)".
          when 23 then return "MAPI_E_NETWORK_FAILURE (23)".
          when 24 then return "MAPI_E_INVALID_EDITFIELDS (24)".
          when 25 then return "MAPI_E_INVALID_RECIPS (25)".
          when 26 then return "MAPI_E_NOT_SUPPORTED (26)".
          otherwise    return "Erro desconhecido (" + string(retorno) + ")".
       end case.
    end function.
    
    run mail (input "fulano@doninio.com.br,beltrano@dominio.com.br",   /* e-mail destinatario */
              input "Assunto da Mensagem",                             /* Assumto */
              input "Teste de envio de email.",                        /* Corpo do e-mail */
              input "C:\arquivo1.txt,C:\arquivo2.txt",                 /* Anexo */
              input 0,                                                 /* 1 mostra janela 0 envia direto */
              output retorno).
    
    if retorno <> 0 then
       message
          "Erro ao enviar e-mail." skip(1)
          emailerro()
          view-as alert-box.
    
    procedure mail external "dlls\xpMail.dll":
        def input  parameter mailto      as char.
        def input  parameter mailsubject as char.
        def input  parameter mailText    as char.
        def input  parameter mailFiles   as char.
        def input  parameter mailDialog  as long.
        def output parameter retCode     as long.
    end.
    

Compartilhe esta Página