Page 5 of 5

Re: Compilation problem with version 3.0.45

Posted: Wed Nov 14, 2012 7:12 pm
by danielmaximiliano

Code: Select all

20121114-16:09:00  :INETCONNECT( mail.canas.pt, 110 )
>> <pointer> <<

20121114-16:09:00  :INETERRORCODE( <pointer> )
>>          0 <<

20121114-16:09:02  :INETRECVLINE( <pointer>, , 128 )
>> +OK Hello there. <32555.1352920147@localhost.localdomain> <<

20121114-16:09:02  :INETERRORCODE( <pointer> )
>>          0 <<

20121114-16:09:02  :INETSENDALL( <pointer>, 13, USER origem<cr><lf> )
>>         13 <<

20121114-16:09:02  :INETRECVLINE( <pointer>, , 128 )
>> +OK Password required. <<

20121114-16:09:02  :INETERRORCODE( <pointer> )
>>          0 <<

20121114-16:09:02  :INETSENDALL( <pointer>, 17, PASS 0123456789<cr><lf> )
>>         17 <<

20121114-16:09:07  :INETRECVLINE( <pointer>, , 128 )
>> -ERR Login failed. <<

20121114-16:09:07  :INETERRORCODE( <pointer> )
>>          0 <<

Re: Compilation problem with version 3.0.45

Posted: Wed Nov 14, 2012 11:56 pm
by Carlos Reis
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