Hello wizzards of Harbour,
I had to reinstall the whole Harbour/MiniGui environment, because my hardware supplier cleared my harddisk.
Since then I can't find the function HB_SendMail.
I tried to include many files, like #include <hfcl.ch>, but HB_SendMail seems to be dissapeared.
I the new set of Sample Applications I found the nice program SendMail.prg by Lopez, Filatov and Martinez.
I'm thinking of taking out de essential mail function, so that it can be integrated in other programs like HB_Sendmail.
Is this a good idea or am I missing some information?
If it's a good idea, I would like to share the result.
Please reply and thanks in advance,
WimS
Loosdrecht-Netherlands
SendMail
Moderator: Rathinagiri
Re: SendMail
Hello,WimS wrote:Hello wizzards of Harbour,
I had to reinstall the whole Harbour/MiniGui environment, because my hardware supplier cleared my harddisk.
Since then I can't find the function HB_SendMail.
I tried to include many files, like #include <hfcl.ch>, but HB_SendMail seems to be dissapeared.
I the new set of Sample Applications I found the nice program SendMail.prg by Lopez, Filatov and Martinez.
I'm thinking of taking out de essential mail function, so that it can be integrated in other programs like HB_Sendmail.
Is this a good idea or am I missing some information?
If it's a good idea, I would like to share the result.
Please reply and thanks in advance,
WimS
Loosdrecht-Netherlands
The function HB_SendMail() is Harbour related and it's placed in the HBTIP contrib library.
Please take a look for the following sample of using for GMAIL server from the Harbour distribution:
Code: Select all
/*
* Copyright 2009 Viktor Szakats (vszakats.net/harbour)
* www - http://harbour-project.org
*
* Gmail work with ssl on port 465 and with tls on port 587
* tls mode is fully automatic and require that ssl must be disabled at first (We will activate it on request after STARTTLS command)
*/
#require "hbssl"
#require "hbtip"
REQUEST __HBEXTERN__HBSSL__
#include "simpleio.ch"
PROCEDURE Main( cFrom, cPassword, cTo, cPort)
IF ! tip_SSL()
? "Error: Requires SSL support"
RETURN
ENDIF
hb_default( @cFrom , "<myname@gmail.com>" )
hb_default( @cPassword, "<mypassword>" )
hb_default( @cTo , "addressee@domain.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
Hope that usefulc:\hb32\bin\hbmk2 -lhbtip -lhbssl -llibeay32 -lssleay32 -env:HB_TIP_OPENSSL=yes gmail.prg
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Re: SendMail
Dear mr Filatov,
Thank you very much. Your email functions are super.
Also thanks to Mr Serge Girard. He helped me out of troubles:
I had installed HMGExtended Harbour MiniGui
Now the official HMG (download on top of this page) is installed, everything works flawlessly again.
WimS
Loosdrecht-Netherlands
Thank you very much. Your email functions are super.
Also thanks to Mr Serge Girard. He helped me out of troubles:
I had installed HMGExtended Harbour MiniGui
Now the official HMG (download on top of this page) is installed, everything works flawlessly again.
WimS
Loosdrecht-Netherlands