hb_SendMail / tip_MailSend and CDO

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

hb_SendMail / tip_MailSend and CDO

Post by Pablo César »

This is a step-by-step guide on how to use hb_SendMail and tip_MailSend.

Both functions require two libraries: hbtip and hbssl that are already in the HMG Harbour lib folder.
These need to be included in your project .hbc file.

Also need 2 external libraries that are named after files: libeay32.dll and ssleay32.dll. They also need to be included in your project .hbc file.
These libraries are available for use in the HMG 3.4.3 release so you do not have to download them again.

But in case you want to use a later version of HMG and with changes to the functions in Harbour.
You can download it from: http://slproweb.com/products/Win32OpenSSL.html

If you want to download to use HMG in 64bit, choose the appropriate file.
In this version is available as I said earlier for the HMG version 3.4.3 in 32bits and was downloaded as indicated in the figure below:
Screen30.png
Screen30.png (104.83 KiB) Viewed 7560 times
Please note that I have not downloaded the first one because it is a more current version and is for the modified functions of Harbour (Viktor version, not the one we use).

Libraries should be included in the hbc file of your project as follows:
libs=hbtip
libs=hbssl
libs=libeay32
libs=ssleay32

You can edit the hbc file or put it in the IDE as follows:
Screen27.png
Screen27.png (7.14 KiB) Viewed 7657 times
After you download the SSL installation package, you install it in a folder on your computer as shown in the sequence of figures below:
Screen29.png
Screen29.png (121.03 KiB) Viewed 7657 times
The installation will occur (if you do not rename) normally in the folder: OpenSSL-Win32, there are the two dll files that need to be copied into the folder of your project.

Now just compile, either through the IDE or the command line with Build.bat
Last edited by Pablo César on Sat Dec 10, 2016 1:11 am, edited 4 times in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

hb_SendMail / tip_MailSend and CDO

Post by Pablo César »

The message above do not supports more attached files. By this reason I am doing here at this other message.
hb_sendmail.rar
Source Files + Libs
(589.75 KiB) Downloaded 430 times
tip_MailSend.rar
Source Files + Libs
(580.34 KiB) Downloaded 405 times
tip_MailSend functions and subfunctions are copied from Harbour core of Viktor version.

My thanks to Daniel Maximiliano for helping me to understand the use of hb_sendmail and to all those who helped with tips. I hope I have gathered everything here.
Last edited by Pablo César on Sat Dec 10, 2016 1:38 am, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: hb_SendMail / tip_MailSend

Post by EduardoLuis »

Hi Pablo:
First thanks forma share.
Second: true didáctica explanación.
Eduardo
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: hb_SendMail / tip_MailSend

Post by Rathinagiri »

Really useful to everyone. Thanks a lot Pablo.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: hb_SendMail / tip_MailSend

Post by bpd2000 »

Thank for tip and guidance
BPD
Convert Dream into Reality through HMG
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: hb_SendMail / tip_MailSend

Post by mol »

Thank you!
Do we need to install SSL installation package?
Whether it will be sufficient to copy the files libeay.dll and ssleay.dll to project folder?
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

hb_SendMail / tip_MailSend and CDO

Post by Pablo César »

Thank you for your interest friends, It's a pleasure to attend in this more common need.

That's right Marek, you do not have to install anything. Unless there is some change in the hb_SendMail functions of Harbour (in the future). This may occur as Viktor has adapted the newest library (Win32/64 OpenSSL v.1.1) with encryption in the SSL libraries. We are using Win32/64 OpenSSL v.1.0, its names are different now. Probably in our Harbour version will changes. For now, I think can be adapted it too for the newest SSL version (I need to make some tests, I don't know yet).

Just have these two DLLs (libeay32.dll and ssleay32.dll) in the current application folder and specify the four libraries in the hbc file to be compiled. The rest of the two other libraries (hbtip and hbssl), the Harbour, have been available for a long time.
Last edited by Pablo César on Sat Dec 10, 2016 1:38 am, edited 2 times in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: hb_SendMail / tip_MailSend

Post by serge_girard »

Thanks a lot Pablo, really usefull because I use it often!

Serge
There's nothing you can do that can't be done...
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: hb_SendMail / tip_MailSend

Post by mol »

Both dll's are in my project home directory, I also copied them to hmg\lib folder and harbour\lib\win\mingw directory and still I got linker error

Code: Select all

d:/hmg343/mingw/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llibeay
d:/hmg343/mingw/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lssleay
collect2.exe: error: ld returned 1 exit status
hbmk2[FAKTURY]: Error: Running linker. 1
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Compiling error by Marek

Post by Pablo César »

mol wrote:I also copied them to hmg\lib folder and harbour\lib\win\mingw directory and still I got linker error
Sorry to say but this is not a good practice. I never told you to copy any lib in your HMG. Even it is not good to mix versions, either of Harbour or HMG.

I don't know if is this your case but anyway I can say that I forgot to highlight that when compiling in 64bit SSL libraries should also be 64bit.

This is already mentioned on the external SSL library site itself.
(See the first figure posted in this topic. I'm mentioning it's for 32bit.)
Last edited by Pablo César on Sat Dec 10, 2016 1:38 am, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply