SendMail2 (how to make it work?)

280 views
Skip to first unread message

Pete

unread,
Nov 6, 2023, 4:55:56 AM11/6/23
to Harbour Minigui
There is this wonderful emailing applet
\SAMPLES\Applications\SendMail2\SendMail2
Unfortunately, I cannot "convince" it to send emails.
I did try every given method in settings with no avail.
Any hint? 
Thanks in advance!

regards, 
Pete

Joao Carlos

unread,
Nov 7, 2023, 9:17:07 AM11/7/23
to Pete, Harbour Minigui
Hi, I have the same problem

--
Visit our website on https://www.hmgextended.com/ or https://www.hmgextended.org/
---
You received this message because you are subscribed to the Google Groups "Harbour Minigui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minigui-foru...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/minigui-forum/bfa1060d-2458-464a-ac04-060506efbb87n%40googlegroups.com.


--
João Carlos de Souza
Especialista Sistemas (11) 9.7378-8895

Pete

unread,
Nov 8, 2023, 4:33:44 AM11/8/23
to Harbour Minigui
Hmm... seems we're moving, a bit...
I was able to setup a Yahoo application password and send email
via a yahoo account with options CURL/SSL
Also was able to send emails via a local ISP's email account
with options CDO/SSL.

But!  this (...) GMAIL keeps denying acces. :-(
In the past, also they offered the option to create an application password, 
but seems they have removed it this capability (or I can't find it in settings).
The worst thing is that more of customers make use of Gmail so it's important
to find a way to make GMAIL work. 
Any idea, anybody?

regards,
Pete

Harbour Minigui

unread,
Nov 8, 2023, 10:50:44 AM11/8/23
to Harbour Minigui
Good morning everyone.
Given the requests I decided to solve the problem of my example of SendMail2 and Gmail.

I can confirm that with SendMail2 it is possible to send emails using Google.
The steps to take are:
1)Log into your Google account
2)Select security
3)Enable 2-step authentication and within it choose passwords for the apps.
Give the application a name, a long password including spaces will be generated
The entire password (including spaces) must be used for SMTP authentication

Due to the presence of spaces SendMail2 requires small changes
Line 818 goes from:
aadd(acCmd," --user "+cFrom+":"+cPassword)
to like this:
aadd(acCmd,[ --user "]+cFrom+":"+cPassword+["])

Line 1118  cBuff := Space( 1024 )  e
Line  1128 nBytes := FRead( hStdOut, @cBuff, 1024 )
change to:
1118  cBuff := Space( 2048 )
1128  nBytes := FRead( hStdOut, @cBuff, 2048 )
 
At this point SendMail 2 can use both CDO and CURL using Google as the provider
and the following parameters: smtp.gmail.com port 465 SSL

If Grigory has further time available for a new Release these and other active changes
will be distributed.

Happy programming with Minigui Exteded.

--
Pierpaolo Martinello [ Minigui Extended Team ]
IW1CUY Ham Radio From Biella Italy
Linux User 177880

Pete

unread,
Nov 9, 2023, 3:33:08 AM11/9/23
to Harbour Minigui
Many thanks, Pierpaolo!
GMail gets more and more restrictive and complicated to use,
probably we should look at more flexible alternatives...
Yahoo seems to be a little bit better in this context, but any other
suggestion would be welcome.
Anyhow, Sendmail2 is a very nice applet, really useful and easy to use, thanks again.
 
regards,
Pete

Harbour Minigui

unread,
Nov 9, 2023, 12:01:58 PM11/9/23
to Harbour Minigui
Hi Pete,
I assure you that if you had to confirm every test email sent with Gmail
I would have gone crazy.
2-factor authentication is only required if you log in to your account with a device
not recognized.
On my PC I have Chrome and I have certified the PC as a safe device, so no problems with gmail!

Regards
--
Pierpaolo Martinello [ Minigui Extended Team ]
IW1CUY Ham Radio From Biella Italy
Linux User 177880

Pete

unread,
Nov 9, 2023, 3:52:25 PM11/9/23
to Harbour Minigui
Hello Pierpaolo,

On Thursday, 9 November 2023 at 19:01:58 UTC+2 Harbour Minigui wrote:
I assure you that if you had to confirm every test email sent with Gmail
I would have gone crazy.
  I hope not! ;-) 
2-factor authentication is only required if you log in to your account with a device
not recognized.
I think, confirmation is needed any time you attempt to login after a logout,
but since you mention it,  I will do a more thorough testing after setting up some
customer's account and let see how it'll go. I really wish it to be easy enough, for plain users.

PS. I have no time right now to investigate the code of sendmail2.prg
      but it might be interesting to try to implement send CURL option 
      by using hbcurl contrib library, to avoid calling external curl.exe.

regards,
Pete

Pierpaolo Martinello

unread,
Nov 10, 2023, 11:39:48 AM11/10/23
to Harbour Minigui
Il giorno giovedì 9 novembre 2023 alle 21:52:25 UTC+1 pete....@gmail.com ha scritto:
Hello Pierpaolo,

On Thursday, 9 November 2023 at 19:01:58 UTC+2 Harbour Minigui wrote:
I assure you that if you had to confirm every test email sent with Gmail
I would have gone crazy.
  I hope not! ;-) 

Don't worry, nothing happened, everything worked straight away!

2-factor authentication is only required if you log in to your account with a device
not recognized.
I think, confirmation is needed any time you attempt to login after a logout,
but since you mention it,  I will do a more thorough testing after setting up some
customer's account and let see how it'll go. I really wish it to be easy enough, for plain users.

PS. I have no time right now to investigate the code of sendmail2.prg
      but it might be interesting to try to implement send CURL option 
      by using hbcurl contrib library, to avoid calling external curl.exe.

SendMail2 is an alternative demo that deliberately uses Curl.exe and not the classic one
hbcurl library.
The reason for this choice is linked to the need not to use SSL certificates from which some libs
they depend and starting from Windows 10 build 17063 curl is integrated into the operating system.
However, it is possible to use hbcurl with the commands contained in SendMail2.
SendMail2 was also successfully tested on seven32Bit by adding curl.exe 32Bit

With this demo you have an alternative idea to build on.

regards,
Pete

Reply all
Reply to author
Forward
0 new messages