Hi
I'm in trouble with my windev 20 app. Just stop to send email. I try with 2 gmail accounts, smtp2go and my internet service provider. Nothing Works.
Here is the code:
I'm in trouble with my windev 20 app. Just stop to send email. I try with 2 gmail accounts, smtp2go and my internet service provider. Nothing Works.
Here is the code:
// cria sessão de envio de email
MySession is EmailSMTPSession
MySession..Name = "user@gmail.com"
MySession..Password = "password"
MySession..ServerAddress = "smtp.gmail.com"
MySession..Port = 587
MySession..Option = emailOptionSecuredTLS
// cria o anexo da mensagem
myAnexo is EmailAttach
myAnexo..Name = sAnexo
myAnexo..Content=fLoadText(sAnexo)
myAnexo..ContentType="application/xml"
myAnexo..ContentDescription="A XML document"
// cria o corpo da mensagem
IF EmailStartSession(MySession) = True THEN
// Build an email
MyMessage is Email
MyMessage..Subject = sAssunto
MyMessage..Sender = "Brascol"
Add(MyMessage..Recipient,sDestino)
Add(MyMessage..Attach,myAnexo)
MyMessage..Message = sMensagem
// envia a mensagem
IF NOT EmailSendMessage(MySession,MyMessage) THEN
ToastDisplay("Falha ao enviar mensagem.",toastLong,vaMiddle,haCenter,DarkRed)
ELSE
ToastDisplay("Mensagem enviada com sucesso.",toastShort,vaMiddle,haCenter)
END
ELSE
Error("falha de conexão")
END
EmailCloseSession(MySession)