Jump to content
Fivewin Brasil

ENVIO SMS ZENVIA


edutraini

Recommended Posts

Bom dia

 

///

   oWS                := WebConnect():New()
   cTexto             := ' '
   cUser              := 'nomedousuario'
   cSenha             := 'senhaenviadapelazenvia'
   cTelefone          := '5531991143593'
   cMensagem          := 'Mensagem de Teste'
 
     cTexto    := oWS:Open( 'https://api-http.zenvia.com/GatewayIntegration/msgSms.do?account='+cUser+'&code='+cSenha+'&dispatch=send&to='+cTelefone+'&msg='+cMensagem )
 
      if len( cTexto ) >= 3 .and. substr(cTexto,1,3) = '000'
         lRetorno := .t.
      elseif len( cTexto ) >= 3 .and. substr(cTexto,1,3) = '990'
         MsgStop('Erro ao enviar SMS, possivelmente estourou a cota!'+CRLF+cTexto,'Erro' )
         lRetorno := .f.
      elseif len( cTexto ) >= 3 .and. substr(cTexto,1,3) = '900'
         MsgStop('Erro ao enviar SMS, Erro de Autenticação!'+CRLF+cTexto,'Erro' )
         lRetorno := .f.
      else
         lRetorno := .f.
      endif
 
   syswait(.2)
   sysrefresh()
   oWS:end()

////


Trecho do meu código

Deve te ajudar

Um abraço,

Alexandre Pereira
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...