hbCURL and Email ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

hbCURL and Email ?

Post by AUGE_OHR »

hi

i have read that hbTIP may make Problem and hbCURL should be used.
did somebody have a Email-Solution using hbCURL and OpenSSL :?:
have fun
Jimmy
Pcmodula
Posts: 37
Joined: Thu Nov 22, 2012 6:00 pm

Re: hbCURL and Email ?

Post by Pcmodula »

AUGE_OHR wrote: Wed Jun 29, 2022 2:55 pm hi

i have read that hbTIP may make Problem and hbCURL should be used.
did somebody have a Email-Solution using hbCURL and OpenSSL :?:
Hi Jimmy, Minigui Extended can help you.
Search Sendmail2.
It contain 3 types of send.
Socket, cdo, curl and i have tested It with one account that require SSL settings.
Can be a start for solve your request.
Have fun
Pcmodula
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: hbCURL and Email ?

Post by AUGE_OHR »

hi,
Pcmodula wrote: Wed Jun 29, 2022 4:50 pm Search Sendmail2.
It contain 3 types of send.
Socket, cdo, curl and i have tested It with one account that require SSL settings.
Can be a start for solve your request.
i can´t find "Sendmail2" :(
can you point me please in which Folder i found Sample with "Sendmail2" (MiniGUI Version ? )
have fun
Jimmy
Pcmodula
Posts: 37
Joined: Thu Nov 22, 2012 6:00 pm

Re: hbCURL and Email ?

Post by Pcmodula »

AUGE_OHR wrote: Wed Jun 29, 2022 5:06 pm hi,
Pcmodula wrote: Wed Jun 29, 2022 4:50 pm Search Sendmail2.
It contain 3 types of send.
Socket, cdo, curl and i have tested It with one account that require SSL settings.
Can be a start for solve your request.
i can´t find "Sendmail2" :(
can you point me please in which Folder i found Sample with "Sendmail2" (MiniGUI Version ? )
samples\Applications\SendMail2
If my memory don't fail
I suggest to check into changelog.txt of this year.

Saludos
Pcmodula
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: hbCURL and Email ?

Post by AUGE_OHR »

hi,
Pcmodula wrote: Wed Jun 29, 2022 8:17 pm Search Sendmail2.
It contain 3 types of send.
Socket, cdo, curl and i have tested It with one account that require SSL settings.
Can be a start for solve your request.
have just upgrade to latest MiniGUI Extendet Version and found SendMail2

Code: Select all

      do case
         case adata[2][9]   // use Cdo
         case adata[2][8]   // use Curl
       OtherWise           // use Tsmtp by Matteo Baccan
so i search for TSMTP and found

Code: Select all

c:\minigui\SOURCE\Socket\tsmtp.prg
c:\minigui\SOURCE\Socket\tpop3.prg
but looking into Source i do not found SSL / TLS ... but (old) Port 25 ... hm
i guess both CLASS does not handle SSL / TLS > 1.1 which is need now

---

as i know Collaboration Data Objects (CDO) is not support any more since Server 2016
Server 2016 now use Exchange Web Services (EWS) but it have no COM Interface.
not sure if CDO will work in Future

---

CURL.EXE is Part of Windows 10/11 and use Parameter for Email.

Question : are hbCURL and CURL.EXE the "same" :?:

i will try CURL.EXE Way but i would prefer to use hbCURL "internal" in my Apps

thx for help
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: hbCURL and Email ?

Post by danielmaximiliano »

Hi Jimmy
TRY download Curl
example : https://curl.se/windows/dl-7.84.0_3/cur ... -mingw.zip
extract and copy to folder
2022-07-01 22_25_55-curl.png
2022-07-01 22_25_55-curl.png (13.27 KiB) Viewed 3765 times
use this batch

Code: Select all

set HB_WITH_CURL=C:\curl\include
set HB_STATIC_CURL=yes
set path= %path%;c:\hmg.3.5
build64  hbcurl.hbp
pause
in folder
2022-07-01 22_28_10-hbcurl.png
2022-07-01 22_28_10-hbcurl.png (13.11 KiB) Viewed 3765 times
see content in build.log
hbmk2: Construyendo sub-proyecto (nivel 2): hbcurls.hbp
hbmk2: Dependencia 'curl' encontrada: C:\curl\include
hbmk2: Harbour: Compilando m¢dulos...
Harbour 3.2.0dev (r1604201603)
Copyright (c) 1999-2016, http://harbour-project.org/
hbmk2: Compilando...
In file included from C:/curl/include/curl/curl.h:3103:0,
from ../../../../core.c:49:
../../../../core.c: In function 'HB_FUN_CURL_EASY_GETINFO':
C:/curl/include/curl/typecheck-gcc.h:139:13: warning: call to '_curl_easy_getinfo_err_curl_certinfo' declared with attribute warning: curl_easy_getinfo expects a pointer to 'struct curl_certinfo *' for this info
_curl_easy_getinfo_err_curl_certinfo(); \
^
../../../../core.c:1787:60: note: in expansion of macro 'curl_easy_getinfo'
#define HB_CURL_EASY_GETINFO( hb_curl, n, p ) ( hb_curl ? curl_easy_getinfo( hb_curl->curl, n, p ) : ( CURLcode ) HB_CURLE_ERROR )
^
../../../../core.c:1975:19: note: in expansion of macro 'HB_CURL_EASY_GETINFO'
res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_CERTINFO, &ret_slist );
^
hbmk2: Creando librer¡a est tica... libhbcurls.a
hbmk2: Dependencia 'curl' encontrada: C:\curl\include
hbmk2[hbcurl]: Advertencia: Fuentes de Biblioteca de importaci¢n no se
encontraron.
hbmk2: Harbour: Compilando m¢dulos...
Harbour 3.2.0dev (r1604201603)
Copyright (c) 1999-2016, http://harbour-project.org/
hbmk2: Compilando...
In file included from C:/curl/include/curl/curl.h:3103:0,
from ../../../../core.c:49:
../../../../core.c: In function 'HB_FUN_CURL_EASY_GETINFO':
C:/curl/include/curl/typecheck-gcc.h:139:13: warning: call to '_curl_easy_getinfo_err_curl_certinfo' declared with attribute warning: curl_easy_getinfo expects a pointer to 'struct curl_certinfo *' for this info
_curl_easy_getinfo_err_curl_certinfo(); \
^
../../../../core.c:1787:60: note: in expansion of macro 'curl_easy_getinfo'
#define HB_CURL_EASY_GETINFO( hb_curl, n, p ) ( hb_curl ? curl_easy_getinfo( hb_curl->curl, n, p ) : ( CURLcode ) HB_CURLE_ERROR )
^
../../../../core.c:1975:19: note: in expansion of macro 'HB_CURL_EASY_GETINFO'
res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_CERTINFO, &ret_slist );
^
hbmk2: Creando librer¡a est tica... libhbcurl.a
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: hbCURL and Email ?

Post by AUGE_OHR »

hi,

thx for Answer.

i found out that my Enail Provider WEB.DE make much Problem with SendMail2 Sample

when send from my 2nd Email Account T-ONLINE.DE -> WEB.DE a Email using CURL.EXE i got
The mail system

<Auge_Ohr@Web.DE>: host mx-ha02.Web.DE[212.227.17.8] said: 554-Transaction
failed 554-Reject due to policy restrictions. 554 For explanation visit
https://web.de/email/senderguidelines?i ... 34.81&c=hi (in reply to
end of DATA command)
---

"send" Email using

Code: Select all

aadd(acCmd, "--ssl-reqd --url smtps://")
with Port 587 i got
curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - Das Token, das der Funktion übergeben wurde, ist ungültig.
using Port 465
i got
#=#=#
##O#-#
curl: (67) Login denied
---

without "s"

Code: Select all

aadd(acCmd, "--ssl-reqd --url smtp://")
with Port 587 i got
#=#=#
##O#-#
curl: (67) Login denied
using Port 465
#=#=#
##O#-#
##O=# #
#=#=-# #
-#O#- # #
-=#=# # #
-=O#-# # #
-=O=# # # #
-=O=-# # # #
-=O=- # # # #
-=O=- # # # #
curl: (56) response reading failed
but it work with T-ONLINE.DE so it is a Problem of WEB.DE :!:

---

when try to send from WEB.DE these Parameter are recommend by WEB.DE

Code: Select all

smtp.web.de
STARTTLS Port 587
so did CURL.EXE don´t know STARTTLS :?:
any Idea what i can do :idea:

p.s. it work with HbTIP and OpenSSL v1.0.2.20
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: hbCURL and Email ?

Post by AUGE_OHR »

hi,

i have change some Code and Login "seems" to work but later still got Error

Code: Select all

CURL.EXE --insecure --ssl-reqd --url smtps://smtp.web.de:465 --user XXXXXXXX@web.de:Password --mail-from XXXXXXXX@web.de --mail-rcpt YYYYYYYY@t-online.de --stderr G:\minigui\2\SendMail\CurlReply.txt --upload-file G:\minigui\2\SendMail\Template.eml

Code: Select all

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   346    0     0  100   346      0   1114 --:--:-- --:--:-- --:--:--  1119
curl: (56) Failure when receiving data from the peer
so what is Error 56 mean ... :?:
have found many Message about it but none belong to Email

need some Idea :idea:
have fun
Jimmy
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: hbCURL and Email ?

Post by mol »

Hi!
Did you resolve your problem?

I want to connect to this topic with such a problem.
I want to leave a copy of the sent mail on the mail server sent items folder.
Does anybody know how to do it?
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: hbCURL and Email ?

Post by serge_girard »

For simple email-sending (not mass-bulk) I use Thunderbird-Mozilla command-line.
This works fine but sending email needs manual click on send-button...

Serge
There's nothing you can do that can't be done...
Post Reply