Hello Daniel
the user and password that I used in the program was just an example obviously does not correspond to reality.
could still have further simplified the example of routine because the aim was to hb_SendMail function ()
that it works well in version 3.0.35 HMG but does not work in version 3.0.46 HMG
down I enclose a version of the routine further simplified only to test the sending of e-mail now with real user and password
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_Main ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'Main Window' ;
MAIN
@ 200,250 BUTTON Bt_email_704a ;
CAPTION 'Send test E-Mail' ;
Width 150 ;
ACTION { || sendmail()}
END WINDOW
CENTER WINDOW Form_Main
ACTIVATE WINDOW Form_Main
Return
// ------------ funcao de enviar e-mail ----
Function sendmail()
local xbody := ' this is the body of the e-mail '
local xsubject := 'teste '
local xFil := {}
local cServer := "smtp.gmail.com"
local nPort := 25
local cFrom := "
pedro.silva256@gmail.com"
local xTo := "
carlos.reis@canas.pt"
local xCC := ""
local xBCC := "
pedro.silva256@gmail.com"
local cBody := xbody
local cSubject := xsubject
local aFiles := xfil
local cUser := "pedro.silva256"
local cPass := "pedro256"
local cPopServer := "mail.gmail.com"
local nPriority := 3
local lRead := .f.
local bTrace := .f.
local lPopAuth := .T.
local lNoAuth := .t.
local nTimeOut := 1000
local cReplyTo := ""
local lTLS := .T.
local cSMTPPass := ""
local cCharset := ""
local cEncoding := ""
if hb_SendMail( cServer, nPort, cFrom, xTo, xCC , xBCC , cBody, cSubject, aFiles, cUser, cPass, cPopServer, nPriority, lRead, bTrace,lPopAuth,lNoAuth, nTimeOut, cReplyTo, lTLS , cSMTPPass, cCharset, cEncoding )
msginfo( "E-Mail sended")
else
MSGINFO("Can't send the mail ")
Endif
return Nil