Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

WD20 Dont send email (1 reply)

$
0
0
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:

// 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)



Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>