Página 1 de 2

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 24 Set 2012 17:41
por Alexandre Silva
Uso o Blat em varios clientes, funciona 100% clipper e harbour..
mas para um cliente dá esse erro Must issue a STARTTLS command first.

Código: Selecionar todos

2012.09.24 16:51:42 (Mon)------------Start of Session-----------------
<<<getline<<< 220 mx.google.com ESMTP p36sm26157576yhe.20
>>>putline>>> EHLO emaildestino@gmail.com
<<<getline<<< 250-mx.google.com at your service, [201.34.148.223]
<<<getline<<< 250-SIZE 35882577
<<<getline<<< 250-8BITMIME
<<<getline<<< 250-STARTTLS
<<<getline<<< 250 ENHANCEDSTATUSCODES
Sending corpoe.txt to emaildestino@gmail.com
Subject: Arq.XML Emissao.: 03/09/2012
Login name is nfe@nomecliente.com.br
>>>putline>>> AUTH LOGIN
<<<getline<<< 530 5.7.0 Must issue a STARTTLS command first. p36sm26157576yhe.20
The SMTP server does not require AUTH LOGIN.
Are you sure server supports AUTH?
>>>putline>>> MAIL FROM:<nfe@nomecliente.com.br>
<<<getline<<< 530 5.7.0 Must issue a STARTTLS command first. p36sm26157576yhe.20
The SMTP server does not like the sender name.
Have you set your mail address correctly?
>>>putline>>> QUIT
<<<getline<<< 221 2.0.0 closing connection p36sm26157576yhe.20
2012.09.24 16:51:43 (Mon)-------------End of Session------------------
Uso esse log para mandar o e-mail...

-f nfe@nomecliente.com.br
-to emaildestino@gmail.com
-bodyf corpoe.txt
-subject "Arq.XML NFe:000013 Emissao.: 03/09/2012"
-debug
-log eresult.txt
-server smtp.gmail.com
-r
-mailfrom nfe@nomecliente.com.br
-u nfe@nomecliente.com.br
-pw SENHA

O e-mail do meu cliente que manda esta configurado no gmail.
Alguma coisa haver com porta ? SSL ?? Hostname ??

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 25 Set 2012 09:49
por Jairo Maia
Olá Alexandre,

Não uso e não conheço o Blat, mas tem uma mensagem clara ai: Must issue a STARTTLS command first.

Eu traduziria assim: Deve-se usar o comando STARTTLS antes. Se você sabe do que se trata, tente iniciar este comando antes de iniciar o envio de email.

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 25 Set 2012 10:14
por Toledo
Alexandre, GMAIL é meio complicado de se usar! Tenho um cliente que estava na mesma situação, tinha domínio próprio, mas usada o gmail.com para envio de e-mails. A única maneira que consegui foi usando CDO (usando o sistema de busca do fórum se encontra muita coisa sobre CDO) e configurando a PORTA 25, apesar que no site da gmail informar que a porta tem que ser 465 (http://support.google.com/mail/bin/answ ... swer=77659).

Tente configurar o blat com a porta 25 ou 465.

Abraços,

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 25 Set 2012 13:18
por Alexandre Silva
tente iniciar este comando antes de iniciar o envio de email.
Mas nao tem esse comando...ou nao sei qual é ..O Blat tem varias opcoes de configuaracao.. deve ter uma para contornar isso..

Outra coisa: O Smtpsend vinha funcionando no cliente, parou. O Smtpsend no meu micro,usando a conta e senha do cliente funciona, mas leva mais de 1 minuto para mandar um arquivo de 1k.

Código: Selecionar todos


Win32 console utility to send mail via SMTP
by P.Mendes,M.Neal,G.Vollant,T.Charron,T.Musson,H.Pesonen,A.Donchey,C.Hyde
  http://www.blat.net
syntax:
  Blat <filename> -to <recipient> [optional switches (see below)]
  Blat -install <server addr> <sender's addr> [<try>[<port>[<profile>]]] [-q]
  Blat -profile [-delete | "<default>"] [profile1] [profileN] [-q]
  Blat -h

-------------------------------- Installation ---------------------------------
-install[SMTP] <server addr> <sender's addr> [<try n times> [<port>
     [<profile> [<username> [<password>]]]]]
     : set's server, sender, number of tries and port for profile
       (<try n times> and <port> may be replaced by '-')
       port default is 25
       default profile can be specified with a '-'
       username and/or password may be stored to the registry
       order of options is specific

--------------------------------- The Basics ----------------------------------
<filename>      : file with the message body ('-' for console input, ^Z ends)
-of <filename>  : text file containing more options (also -optionfile)
-to <recipient> : recipient list (also -t) (comma separated)
-tf <recipient> : recipient list filename
-cc <recipient> : carbon copy recipient list (also -c) (comma separated)
-cf <file>      : cc recipient list filename
-bcc <recipient>: blind carbon copy recipient list (also -bcc)
                  (comma separated)
-bf <file>      : bcc recipient list filename
-maxnames <x>   : send to groups of <x> number of recipients
-subject <subj> : subject line, surround with quotes to include spaces(also -s)
-ss             : suppress subject line if not defined
-sf <file>      : file containing subject line
-body <text>    : message body, surround with quotes to include spaces

----------------------------- Registry overrides ------------------------------
-p <profile>    : send with server, user, and port defined in <profile>
                : use username and password if defined in <profile>
-profile        : list all the profiles in the Registry
-server <addr>  : specify SMTP server to be used (optionally, addr:port)
-serverSMTP <addr>
                : same as -server
-f <sender>     : override the default sender address (must be known to server)
-i <addr>       : a 'From:' address, not necessarily known to the server
-port <port>    : port to be used on the SMTP server, defaults to SMTP (25)
-portSMTP <port>: same as -port
-u <username>   : username for AUTH LOGIN (use with -pw)
-pw <password>  : password for AUTH LOGIN (use with -u)

---------------------- Miscellaneous RFC header switches ----------------------
-organization <organization>
                : Organization field (also -o and -org)
-ua             : include User-Agent header line instead of X-Mailer
-x <X-Header: detail>
                : custom 'X-' header.  eg: -x "X-INFO: Blat is Great!"
-noh            : prevent X-Mailer/User-Agent header from showing Blat homepage
-noh2           : prevent X-Mailer header entirely
-d              : request disposition notification
-r              : request return receipt
-charset <cs>   : user defined charset.  The default is ISO-8859-1
-a1 <header>    : add custom header line at the end of the regular headers
-a2 <header>    : same as -a1, for a second custom header line
-dsn <nsfd>     : use Delivery Status Notifications (RFC 3461)
                : n = never, s = successful, f = failure, d = delayed
                : can be used together, however N takes precedence
-hdrencb        : use base64 for encoding headers, if necessary
-hdrencq        : use quoted-printable for encoding headers, if necessary
-priority <pr>  : set message priority 0 for low, 1 for high

----------------------- Attachment and encoding options -----------------------
-attach <file>  : attach binary file(s) to message (comma separated)
-attacht <file> : attach text file(s) to message (comma separated)
-embed <file>   : embed file(s) in HTML.  Object tag in HTML must specify
                  content-id using cid: tag.  eg: <img src="cid:image.jpg">
-base64         : send binary files using base64 (binary MIME)
-uuencode       : send binary files UUEncoded
-enriched       : send an enriched text message (Content-Type=text/enriched)
-html           : send an HTML message (Content-Type=text/html)
-htmaltf <file> : plain text file for use as alternate text to html
-mime           : MIME Quoted-Printable Content-Transfer-Encoding
-8bitmime       : ask for 8bit data support when sending MIME

-------------------------------- Other options --------------------------------
-h              : displays this help
-q              : suppresses *all* output
-debug          : echoes server communications to screen
-log <filename> : log everything but usage to <filename>
-timestamp      : when -log is used, a timestamp is added to each log line
-ti <n>         : set timeout to 'n' seconds.  Blat will wait 'n' seconds for
                  server responses
-try <n times>  : how many times blat should try to send (1 to 'INFINITE')
-binary         : do not convert ASCII | (pipe, 0x7c) to CrLf in the message
                  body
-hostname <hst> : select the hostname used to send the message via SMTP
                  this is typically your local machine name
-raw            : do not add CR/LF after headers
-------------------------------------------------------------------------------

Note that if the '-i' option is used, <sender> is included in 'Reply-to:'
and 'Sender:' fields in the header of the message.

Optionally, the following options can be used instead of the -f and -i
options:

-mailfrom <addr>   The RFC 821 MAIL From: statement
-from <addr>       The RFC 822 From: statement
-replyto <addr>    The RFC 822 Reply-To: statement
-returnpath <addr> The RFC 822 Return-Path: statement
-sender <addr>     The RFC 822 Sender: statement

For backward consistency, the -f and -i options have precedence over these
RFC 822 defined options.  If both -f and -i options are omitted then the
RFC 821 MAIL FROM statement will be defaulted to use the installation-defined
default sender address.


e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 26 Set 2012 08:18
por Jairo Maia
Alexandre, tem como você postar um exemplo do código que você está usando para enviar o email? Se você postar o código fica mais fácil entender. Este comando é configurado no próprio código. Na internet vi vários exemplos, mas para Java. Poste o código para podermos ajudá-lo a alguma adaptação.

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 26 Set 2012 14:40
por JoséQuintas
O problema do gmail é precisar conexão segura, e isso não tem disponível.
Talvez na sua máquina esteja com a conta gmail conectada e por isso libere.
Quando não tem outro jeito, eu uso um email meu ao invés do email do cliente.

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 26 Set 2012 14:57
por Alexandre Silva
Com certeza o problema é o gmail...ja vi que ou mudo para outro provedor, ou mudo a forma de mandar.. usando CDO *que vou ter que procurar*
Pensava que o harbour oferecece uma funcao pronta para isso, apenas mandado os parametros..

O que faço é gerar esse log.txt
PS: se mudar quem manda por um yahoo, vai passar...

Código: Selecionar todos

-f nfeteste@gmail.com.br
-to testecliente@hotmail.com
-bodyf corpoe.txt
-subject "Arq.XML NFe:0099"
-debug 
-log eresult.txt
-server smtp.gmail.com
-u nfeteste@gmail.com.br
-pw senha
-mailfrom nfeteste@gmail.com.br
-r
e chamo com essa bat
manda.bat
BLAT -of blat.log

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 26 Set 2012 17:49
por Toledo
Exemplo usando CDO com Harbour:

Código: Selecionar todos

Func Main()
Local oCDOMsg, oCDOConf, lVar:=.T.
SETMODE(25,80)

cSMTP:="smtp.gmail.com"
cUser:="nfeteste10@gmail.com"
cSenha:="nfe54321"
nPort:=25
cDe:="nfeteste10@gmail.com"
cPara:="toledo@pctoledo.com.br"
cAssunto:="Teste Arq.XML NFe:0099"
cCorpoMsg:=memoread("corpoe.txt")

IF ( oCDOMsg := win_oleCreateObject( "CDO.Message" ) ) != NIL

     oCDOConf := win_oleCreateObject( "CDO.Configuration" )

     oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/sendusing"            ):Value := 2
     oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver"           ):Value := cSMTP
     if nPort>0
      oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport"       ):Value := nPort
     endif
     oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"):Value := 30
     oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"     ):Value := 1
     oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl"           ):Value := .T.
     oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/sendusername"         ):Value := alltrim(cUser)
     oCDOConf:Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword"         ):Value := alltrim(cSenha)
     oCDOConf:Fields:Update()

     oCDOMsg:Configuration := oCDOConf
     oCDOMsg:To := lower(alltrim(cPara))
     oCDOMsg:From := cDe
     oCDOMsg:Subject := cAssunto
     oCDOMsg:TextBody := cCorpoMsg
*     oCDOMsg:AddAttachment(cFile)
     oCDOMsg:Fields( "urn:schemas:mailheader:disposition-notification-to" ):Value := cDe
     oCDOMsg:Fields:update()

     lVar:=.T.
     BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
        oCDOMsg:Send()
     RECOVER
        lVar:=.F.
     END SEQUENCE
ELSE
    lVar:=.F.
ENDIF

If lVar
  cVar:="E-mail enviado com sucesso!"
Else
   cVar:="Erro no Envio - "+win_oleErrorText()
EndIf
Alert(cVar)
RETURN NIL
Alexandre, fiz um teste com este código e enviei uma mensagem para o seu endereço de e-mail.

Abraços,

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 27 Set 2012 12:52
por Alexandre Silva
Funcionou, mas se tento mandar o anexo...
* oCDOMsg:AddAttachment(cFile)

dá este erro:

Winole/1007 Erros nos paramentros addattachment
Dos error - 2147352567

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 27 Set 2012 13:00
por Toledo
Alexandre, passe o caminho todo onde está o arquivo:

Código: Selecionar todos

cFile:="c:\nomedapasta\subpasta\arquivo.txt"
Abraços,

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 27 Set 2012 13:25
por Alexandre Silva
Que coisa.. estava usando:
..\xml\nomearqquivo.xml , tb tentei usar um arquivo (local)
mas pelo visto tem que ter o cominho completo.

Valeu..

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 27 Set 2012 20:38
por JoséQuintas
Aqui no W7 funcionou.
Funciona em qualquer Windows?
Há alguma opção de enviar o assunto em Html?

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 27 Set 2012 20:39
por JoséQuintas
Econtrei sobre html.
http://support.microsoft.com/kb/286431

Detalhe: essa página mostra usando arquivo VBS. Pode ser útil pra quem usa Clipper.

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 28 Set 2012 00:51
por Alexandre Silva
ok, funcionando, mas preciso anexar mais de um arquivo..
oCDOMsg:AddAttachment(cFile1)

Tentei colocar virgula, ponto e virgula e nao consegui..
Como nao tenho a sintaxe, peço como se faz para mandar mais de 1 anexo..??

e-mail blat ERRO530 5.7.0 Must issue a STARTTLS command firs

Enviado: 28 Set 2012 08:52
por Toledo
JoséQuintas escreveu:Funciona em qualquer Windows?
Nas versões mais recente do Windows funciona sim, só não testei em versões mais antigas (98,95,etc).
Alexandre Silva escreveu:mas preciso anexar mais de um arquivo..
oCDOMsg:AddAttachment(cFile1)
É só acrescentar mais um linha de comando para anexar o segundo arquivo.

Código: Selecionar todos

oCDOMsg:AddAttachment(cFile1)
oCDOMsg:AddAttachment(cFile2)
oCDOMsg:AddAttachment(cFile3)
etc...
Abraços,