Sending Mail
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Sending Mail
Wonderful! Thank you Grigory. I will also try!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Sending Mail
I'm using hb_sendmail() in another solution and it's work OK.
Please point, which dll's we need to copy to app folder to work with SSL.
Regards, Marek
Please point, which dll's we need to copy to app folder to work with SSL.
Regards, Marek
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Sending Mail
libeay32.dll and ssleay32.dll.mol wrote:I'm using hb_sendmail() in another solution and it's work OK.
Please point, which dll's we need to copy to app folder to work with SSL.
I've downloaded SSL from: http://slproweb.com/products/Win32OpenSSL.html
The test machine is Windows 7 Starter 32 bits.
I'm testing with a console app.
I've built using hbmk2 and plain Harbour.
Code: Select all
@echo off
cls
set path=c:\hmg.3.4.1\harbour\bin;c:\hmg.3.4.1\mingw\bin
hbmk2 test.prg hbssl.hbc hbtip.hbc
pause
Code: Select all
REQUEST __HBEXTERN__HBSSL__
*----------------------------------------------------------------------*
Function Main
*----------------------------------------------------------------------*
SETMODE(25,80)
SETCURSOR(0)
SETCOLOR('W+/B')
CLS
@ 0 , 0 SAY REPLICATE( '-', 80 )
@ 1 , 1 SAY 'MAIL TEST'
@ 2 , 0 SAY REPLICATE( '-', 80 )
@ 22 , 0 SAY REPLICATE( '-', 80 )
@ 23 , 1 SAY 'STATUS: WAITING'
@ 24 , 0 SAY REPLICATE( '-', 80 )
@ 06, 22 SAY 'OPTIONS'
@ 08, 22 SAY '1. SEND'
@ 12, 22 SAY 'ESC. EXIT'
DO WHILE .T.
K := INKEY(0.9)
IF K == 49
cTO := 'mail.box.hmg@gmail.com'
cBody := 'Body!'
cSubject:= 'Subject!'
SEND ( cTO , cSubject , cBody )
ELSEIF K == 27
QUIT
ENDIF
ENDDO
RETURN
*----------------------------------------------------------------------*
PROCEDURE SEND ( cTO , cSubject , cBody )
*----------------------------------------------------------------------*
IF ! tip_SSL()
ALERT ( "ERROR SSL" )
RETURN
ENDIF
@ 23 , 1 SAY 'STATUS: STARTING ' + DTOC(DATE()) + ' ' + TIME()
cFrom := "your.user.id@gmail.com"
cPassword := "your.password"
R := hb_SendMail( "smtp.gmail.com", 465, ;
cFrom, ;
cTo, ;
NIL /* CC */, ;
{} /* BCC */, ;
cBody, ;
cSubject, ;
NIL /* attachment */, ;
cFrom, ;
cPassword, ;
"", ;
NIL /* nPriority */, ;
NIL /* lRead */, ;
.T. /* lTrace */, ;
.F., ;
NIL /* lNoAuth */, ;
NIL /* nTimeOut */, ;
NIL /* cReplyTo */, ;
.T. )
IF R
@ 23 , 1 SAY 'STATUS: SEND OK ' + DTOC(DATE()) + ' ' + TIME() + SPACE(40)
ELSE
@ 23 , 1 SAY 'STATUS: SEND ERROR ' + DTOC(DATE()) + ' ' + TIME() + SPACE(40)
ENDIF
RETURN
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Sending Mail
I've used ssl without installing openssl (not gmail account)
It works, strange? (or I'm not learned enough most possible )
It works, strange? (or I'm not learned enough most possible )
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Sending Mail
Well... I've tried to build with HMG.3.4.1 (from IDE) but I was unable to do it.Roberto Lopez wrote: I've not tested with HMG yet (I've not investigated about how to include the additional hbc files required in the current version or if it is needed at all)
How could this be done?
TIA.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Sending Mail
Maybe the account you used not required SSL auth or SSL dlls are already in your Windows system folder...mol wrote:I've used ssl without installing openssl (not gmail account)
It works, strange? (or I'm not learned enough most possible )
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)