Theotokos Posted April 15, 2019 Report Share Posted April 15, 2019 Bom Dia pessoal!!! Estou usando a rotina abaixo para enviar e-mail do fechamento do caixa, apesar de aparecer mensagem de enviando com sucesso não recebo... usando conta gmail para enviar e receber Alguem sabe o que esta de errado ? ou tem alguma outra rotina para enviar e-mail que esteja funcionando? cUsuaID := StrTran( cUsuaID, "@", "&at;" ) cUrl := cProto + cUsuaID + ":" + cPassword + "@" + cServer nPort := EMAIL->PORTA_S // 465 * cFrom := AllTrim(EMAIL->FROM_E) // "rone@rl-informatica.net" cTo := AllTrim(EMAIL->TO_E) // "errosys@rl-informatica.net" cCC := "" cSubject := "Caixa Enviado - "+AllTrim(EMAIL->LOJA_E) cFile := cArqTela cBody := "Enviando Caixa [" + cArqTela + "] " + CRLF + GerarCxArq() * EMAIL->(DbCloseArea()) If Empty(cServer) Return nil EndIf * oUrl := TUrl():New(cUrl , lCreateLogFile := .f.) oUrl:nPort := nPort oUrl:cUserid := cUsuaID * oSmtp := TIpClientSmtp():new( oUrl , lCreateLogFile ) * oEMail := TIpMail():new() oEMail:setHeader( cSubject, cFrom, cTo, cCC ) oEMail:setBody( cBody ) oEMail:attachFile( ALLTRIM(cFile) ) //oEMail:hHeaders[ "Disposition-Notification-To" ] := cFrom // solicita confirmacao oSmtp:nConnTimeout := 2000 IF oSmtp:open() oSmtp:sendMail( oEMail ) oSmtp:close() MsgWait( [Email enviado com sucesso], [RL Informatica], 2) ELSE MSGWait( oSmtp:lastErrorMessage(), "ERRO", 2 ) ENDIF Quote Link to comment Share on other sites More sharing options...
Polirep Posted June 5, 2019 Report Share Posted June 5, 2019 Veja se dentro do gmail a opção USAR APLICATIVOS MENOS SEGUROS está ativada.... TEM QUE ESTAR Quote Link to comment Share on other sites More sharing options...
kapiaba Posted June 5, 2019 Report Share Posted June 5, 2019 Solução aqui: http://www.pctoledo.com.br/forum/viewtopic.php?f=2&t=16294#p130183 Abs Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.