Página 1 de 1

mailsend e-mail AUTH LOGIN failed: '535 Incorrect authentica

Enviado: 26 Set 2022 14:06
por Alexandre Silva
Pessoal, ja uso o aplicativo externo mailsend.exe há anos
agora estou tento esse erro ao enviar, como se ve é problema de autenticacao
O que poderia ser ??

Error: AUTH LOGIN failed: '535 Incorrect authentication data'



bat que manda


@ mailsend -v -info -from faturamento@empresa.com.br -to meuemail@gmail.com -smtp mail.empresa.com.br -sub "Assunto" -starttls -port 587 -auth -portsmtp 587 -log log.txt -user faturamento@empresa.com.br -pass "senha"


e tem essa para porta 465

@ mailsend -v -info -from faturamento@empresa.com.br -to meuemail@gmail.com -smtp mail.empresa.com.br -sub "Assunto" -ssl -port 465 -auth -portsmtp 465 -log log.txt -user faturamento@empresa.com.br -pass "senha"



Log da operacao:

26-set-2022 13:52:08.655: Will detect IPv4 or IPv6 automatically
26-set-2022 13:52:08.718: 220-br34.valueserver.com.br ESMTP Exim 4.95 #2 Mon, 26 Sep 2022 13:54:46 -0300
26-set-2022 13:52:08.718: 220-We do not authorize the use of this system to transport unsolicited,
26-set-2022 13:52:08.718: 220 and/or bulk e-mail.
26-set-2022 13:52:08.718: [C] EHLO localhost
26-set-2022 13:52:08.733: 250-br34.valueserver.com.br Hello localhost [179.190.122.246]
26-set-2022 13:52:08.733: 250-SIZE 52428800
26-set-2022 13:52:08.733: 250-8BITMIME
26-set-2022 13:52:08.733: 250-PIPELINING
26-set-2022 13:52:08.749: 250-PIPE_CONNECT
26-set-2022 13:52:08.749: 250-AUTH PLAIN LOGIN
26-set-2022 13:52:08.749: 250-STARTTLS
26-set-2022 13:52:08.749: [S] 250 HELP
26-set-2022 13:52:08.749: [C] STARTTLS
26-set-2022 13:52:08.764: [S] 220 TLS go ahead
26-set-2022 13:52:08.842: [C] EHLO localhost
26-set-2022 13:52:08.858: [S] 250-br34.valueserver.com.br Hello localhost [179.190.122.246]
26-set-2022 13:52:08.858: [S] 250-SIZE 52428800
26-set-2022 13:52:08.858: [S] 250-8BITMIME
26-set-2022 13:52:08.858: [S] 250-PIPELINING
26-set-2022 13:52:08.858: [S] 250-PIPE_CONNECT
26-set-2022 13:52:08.858: [S] 250-AUTH PLAIN LOGIN
26-set-2022 13:52:08.858: [S] 250 HELP
26-set-2022 13:52:08.858: [C] QUIT
26-set-2022 13:52:09.108: [S] 221 br34.valueserver.com.br closing connection


Opcoes do aplicativo mailsend

Version: @(#) mailsend v1.20b

Copyright: BSD. It is illegal to use this software for Spamming

(Compiled with OpenSSL version: OpenSSL 1.0.2h 3 May 2016)
usage: mailsend [options]
Where the options are:
-copyright - show copyright information
-4 - Force to use IPv4 address of SMTP server
-6 - Force to use IPv6 address of SMTP server
-smtp hostname/IP* - Hostname/IP address of the SMTP server
-port SMTP port - SMTP port
-domain domain - domain name for SMTP HELO/EHLO
-t to,to..* - email address/es of the recipient/s
-cc cc,cc.. - carbon copy address/es
+cc - do not ask for Carbon Copy
-ct seconds - Connect timeout. Default is 5 seconds
-read-timeout seconds - Read timeout. Default is 5 seconds
-bc bcc,bcc.. - blind carbon copy address/es
+bc - do not ask for Blind carbon copy
+D - do not add Date header
-f address* - email address of the sender
-sub subject - subject
-list_address file - a file containing a list of email addresses
-log file - write log messages to this file
-cs character set - for text/plain attachments (default is us-ascii)
-separator character - separator used with -attach. Default is comma (,) If used must be specified before -attach
-enc-type type - encoding type. base64, 8bit, 7bit etc. Default is base64. Special type is "none"
-aname name - name of the attachment. Default is filename
-content-id id - content-id in the attachment
-mime-type type - MIME type
-dispostion val - "attachment" or "inline". Default is "attachment"
-attach file,mime_type,[i/a] (i=inline,a=attachment)
- attach this file as attachment or inline
-show-attach - show attachment in verbose mode, default is no
-show-mime-types - show the compiled in MIME types
-M "one line msg" - attach this one line text message
-content-type type - Content type. Default: multipart/mixed
-msg-body path - Path of the file to include as body of mail
-embed-image image - Path of image to embed in HTML
-H "header" - Add custom Header
-name "Full Name" - add name in the From header
-v - verbose mode
-V - show version info
-w - wait for a CR after sending the mail
-rt email_address - add Reply-To header
-rrr email_address - request read receipts to this address
-rp - return-path address
-ssl - SMTP over SSL
-starttls - use STARTTLS if the server supports it
-auth - try CRAM-MD5,LOGIN,PLAIN in that order
-auth-cram-md5 - use AUTH CRAM-MD5 authentication
-auth-plain - use AUTH PLAIN authentication
-auth-login - use AUTH LOGIN authentication
-user username - username for ESMTP authentication
-pass password - password for ESMTP authentication
-example - show examples
-ehlo - force EHLO
-info - show SMTP server information
-help - shows this help
-q - quiet

The options with * must be specified
Environment variables:
SMTP_USER_PASS for plain text password (-pass)

mailsend e-mail AUTH LOGIN failed: '535 Incorrect authentica

Enviado: 26 Set 2022 16:22
por JoséQuintas
Geralmente a porta de autenticação não é a mesma do envio.

mailsend e-mail AUTH LOGIN failed: '535 Incorrect authentica

Enviado: 26 Set 2022 17:04
por Alexandre Silva
já fiz varias tentativas mudando as portas 465 e 587 e nada
O que vc tentaria ?

mailsend e-mail AUTH LOGIN failed: '535 Incorrect authentica

Enviado: 26 Set 2022 18:35
por JoséQuintas
Alexandre Silva escreveu:já fiz varias tentativas mudando as portas 465 e 587 e nada
O que vc tentaria ?
Configuraria no Thunderbird e olharia como ele configurou.

Geralmente a autenticação, quando exige, é no pop.empresa.com.br, determinada porta, e usuário/senha
E o envio por smtp.empresa.com.br, determinada porta
Pode exigir algo mais, como dá pra ver até na rotina do Harbour.
Nem sei se o 465 tem algo a ver, acho que isso é pra gmail, ou talvez imap, que não sei se serve pra envio.

Não dá pra ficar chutando e não é tudo igual.
Por exemplo, no terra.com.br, conforme o caso, é terra.sao.com.br ou algo assim, então chutar não seria opção.

mailsend e-mail AUTH LOGIN failed: '535 Incorrect authentica

Enviado: 26 Set 2022 18:49
por Alexandre Silva
Foi passado pra configur o SMTP para porta 465, e autenticacao SSL
A questao é somente enviar (nao tem POP)

Estou achando que pode ser alguma coisa do tipo que o gmail começou a exigir:
Autenticacao em 2 etapas, senha para aplicativo externo ..sei lá
Quer dizer que se eu fizesse em harbour toda a rotina, ainda teria problemas ?

O email é da WebMail

mailsend e-mail AUTH LOGIN failed: '535 Incorrect authentica

Enviado: 26 Set 2022 19:17
por Itamar M. Lins Jr.
Olá!
Quer dizer que se eu fizesse em harbour toda a rotina, ainda teria problemas ?
Enquanto não achar o problema, não vai funcionar com nenhum.
No Harbour o gmail, yahoo eu sei que funciona com TIPMAIL.
Mas esse outro ai, precisamos do manual de como é que ele autentica smtp.

valueserver.com.br ? O que é isso? Parece que saiu do ar.

https://pt.hostadvice.com/go/host/13368/

Saudações,
Itamar M. Lins Jr.

mailsend e-mail AUTH LOGIN failed: '535 Incorrect authentica

Enviado: 26 Set 2022 20:03
por Alexandre Silva
eis que o cliente, entrou e preferencias da conta, tirou um filtro e mudou a senha e tudo deu certo
A senha anterior estava funcionando no outlook e no site, entao nao era senha errada..

mailsend e-mail AUTH LOGIN failed: '535 Incorrect authentica

Enviado: 27 Set 2022 11:44
por clodoaldomonteiro
Caso queiram enviar email usando o Driver CDO.

Função de envio:

Código: Selecionar todos

FUNCTION Envia_email(aFiles,cSubject,cDest,cMsg,cServerIp,cFrom,cUser,cPass,vPORTSMTP,cCC,cBCC,vEMAIL_CONF,wSSL_EMAIL)
   **********************************************************************************************************************
   Local lRet := .f.
   Local oCfg, oError
   Local lAut  := .t.

   TRY
      oCfg := CREATEOBJECT( "CDO.Configuration" )

      WITH OBJECT oCfg:Fields
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver"             ):Value := cServerIp   //server SMTP
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserverport"         ):Value := vPORTSMTP
         :Item( "http://schemas.microsoft.com/cdo/configuration/sendusing"              ):Value := 2           // Remote SMTP = 2, local = 1
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"       ):Value := 1           //
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpusessl"             ):Value := .f. //wSSL_EMAIL  // .F. Ou .T.
         :Item( "http://schemas.microsoft.com/cdo/configuration/sendusername"           ):Value := AllTrim(cUser)
         :Item( "http://schemas.microsoft.com/cdo/configuration/sendpassword"           ):Value := AllTrim(cPass)
         :Item( "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"  ):Value := 60
         :Update()
      END WITH

      lRet := .t.

   CATCH oError
      MsgError( "Não Foi possível Enviar o e-Mail!"  +HB_OsNewLine()+ ;
       "Error: "     + Transform(oError:GenCode,   nil) + ";" +HB_OsNewLine()+ ;
       "SubC: "      + Transform(oError:SubCode,   nil) + ";" +HB_OsNewLine()+ ;
       "OSCode: "    + Transform(oError:OsCode,    nil) + ";" +HB_OsNewLine()+ ;
       "SubSystem: " + Transform(oError:SubSystem, nil) + ";" +HB_OsNewLine()+ ;
       "Mensaje: "   + oError:Description, "Atenção" )

   END

   If lRet
      TRY
         oMsg := CREATEOBJECT ( "CDO.Message" )
         WITH OBJECT oMsg
            :Configuration = oCfg
            :From    = cUser //cFrom
            :Sender  = cUser
            :To      = cDest
            :Subject = cSubject
            :TextBody = cMsg

            For x := 1 To Len( aFiles )
               :AddAttachment(AllTrim(aFiles[x]))
            Next

            :MDNRequested  := .T.               // Requiere respuesta
            :DSNOptions    := 14                //Return a DSN if delivery succeeds, fails, or is delayed.

            //:Fields( "urn:schemas:mailheader:disposition-notification-to" ):Value   := cFrom //'retorno@simplesinformatica.com.br'
            //:Fields( "urn:schemas:mailheader:return-receipt-to" ):Value             := cFrom //'retorno@simplesinformatica.com.br'
            :Fields( "urn:schemas:httpmail:importance" ):Value                      := '2'
            :Fields:update()

            :Send()
         END WITH

         lRet := .t.

      CATCH oError
         msg := 'Não Foi Possível Enviar a Mensagem: "' + cSubject+'"' + CRLF
         msg += 'Verifique se existe conexão com a Internet.' + CRLF
         msg += "Destinatário.: " + cDest                     + CRLF
         msg += "Error.:     "  + Str( oError:GenCode)        + CRLF
         msg += "SubC.:      "  + Str( oError:SubCode )       + CRLF
         msg += "OSCode.:    "  + Str( oError:OsCode )        + CRLF
         msg += "SubSystem.: "  + oError:SubSystem            + CRLF
         msg += "Mensagem.:  "  + oError:Description          + CRLF
         msg += "Operação.: ["  + oError:Operation + "]"      + CRLF

         mArgs := oError:Args
         msg += "Argumento: " + ValType(mArgs) + '[' +Alltrim(Str(Len(mArgs)))+ ']' + CRLF

         If ValType(mArgs) = 'C'
            msg += "Argumento: [" + mArgs + "]"

         ElseIf ValType(mArgs) = 'A'
            For i=1 To Len(mArgs)
               msg += Str(i, 1)+" [" + mArgs[i] + "]" +CRLF
            Next
         Endif

         MsgAtencao( msg )

         lRet := .f.
      END

   Endif

   Return lRet
Chamada da Função:

Código: Selecionar todos

Function PW_EnviaEmail( cPwUser, cPwEmail, cPwNome, cPwPass )
   Local mRetorno := .t.

   //mail Simples nao responda
   cFrom    := "...."
   cTo      := Alltrim(cPwEmail)
   cServerIp:= "...."         //servidor smtp
   cSubject := 'SCP21H - Recuperação de Senha'
   cUser    := '....'
   cPass    := '....'
   vPORTSMTP:= 587 //467
   lConf  	:= .T.
   lSSL  	:= .F.
   aFiles 	:= {} // pode ser uma matriz com vários endereços

   cMsg  	:= 'Simples Informática e Consultoria Ltda'
   cMsg  	+= CRLF + 'SCP21H - Sistema de Contabilidade Pública'+CRLF
   cMsg  	+= CRLF + 'Recuperação de Senha do Usuário:'
   cMsg  	+= CRLF + 'Nome: '     + cPwNome
   cMsg  	+= CRLF + 'Usuário: '  + cPwUser
   cMsg  	+= CRLF + 'Senha: '    + cPwPass
   cMsg  	+= CRLF + 'Email: '    + cPwEmail

   mRetorno := Envia_Email(aFiles, cSubject, cTo, cMsg, cServerIp, cFrom, cUser, cPass, vPORTSMTP, '', '', lCONF, lSSL)

   Return mRetorno

Links úteis:

Código: Selecionar todos

https://pctoledo.org/forum/viewtopic.php?f=4&t=10764&start=30
https://pctoledo.org/forum/viewtopic.php?f=2&t=16294&start=15
http://fivewin.com.br/index.php?/topic/26829-erro-ao-enviar-e-mail-via-cdomessage-e-gmail/#comment-278073
https://www.google.com/settings/security/lesssecureapps
https://www.usandoaccess.com.br/tutoriais/enviar-email-usando-o-cdosys.asp