Code: Select all
#include <hmg.ch>
#require "hbtip"
REQUEST __HBEXTERN__HBSSL__
#include "simpleio.ch"
PROCEDURE Main
Public cFrom, cPassword, cTo , cPort
IF ! tip_SSL()
? "Error: Requires SSL support"
RETURN
ENDIF
hb_default( @cFrom , "user@gmail.com" )
hb_default( @cPassword, "passxxxx" )
hb_default( @cTo , "to@server.com" )
hb_default( @cPort , "465" )
? hb_SendMail( ;
"smtp.gmail.com", ;
Val(cPort), ;
cFrom, ;
cTo, ;
NIL /* CC */, ;
{} /* BCC */, ;
"test: body", ;
"test: port "+cPort, ;
NIL /* attachment */, ;
cFrom, ;
cPassword, ;
"", ;
NIL /* nPriority */, ;
NIL /* lRead */, ;
.T. /* lTrace */, ;
.F., ;
NIL /* lNoAuth */, ;
NIL /* nTimeOut */, ;
NIL /* cReplyTo */, ;
iif(cPort=="465",.T.,.F.) /* lSSL */ )
RETURN
[attachment=1]mi pc.png[/attachment]
[attachment=0]correo.png[/attachment] Install openSSL From : https://slproweb.com/products/Win32OpenSSL.html