Page 1 of 1

Sample working send mail

Posted: Tue May 17, 2022 10:23 am
by Romeo
Ciao all

I HAVE NO PROBLEM IF I USE THE BELOW SAMPLE USING PEC MAIL

BUT I GOT ERROR IF I WISH TO USE IT USING NO PEC MAIL, LIKE GMAIL (EXAMPLE)

PLEASE CAN U TELL ME WHAT IS WRONG ?

OR CAN U SEND ME A SMAL EXAMPLE TO SEND MAIL USING NO PEC (OR ALSO PEC)

GRAZIE !!!!

************************** SHORT EXAMPLE ************

function mail_dct(_from,_to,_password,_subject,_textbody,_arrattach,_smtpserver)
LOCAL oEmailMsg
LOCAL cSchema := "http://schemas.microsoft.com/cdo/configuration/"
LOCAL _lok:=.t.,_j,_cfile

b_oxon(10,"Inviando mail...")
oEmailMsg := CREATEOBJECT ( "CDO.Message" )

WITH OBJECT oEmailMsg


:From := alltrim(_from)
:To := alltrim(_to)

:CC := ""
:BCC := ""

:Subject := _subject
:TextBody := _textbody

:AddAttachment( ALLTRIM( "c:\test0.prg" ) )

WITH OBJECT :configuration:Fields

:Item( cSchema + "smtpserver" ):Value := alltrim(_smtpserver)

:Item( cSchema + "smtpserverport" ):Value := 465

:Item( cSchema + "sendusing" ):Value := 2
:Item( cSchema + "smtpauthenticate" ):Value := .T.

:Item( cSchema + "smtpusessl" ):Value := .T.
* only for pec mail :Item( cSchema + "sendtls" ):Value := .T.
:Item( cSchema + "sendtls" ):Value := .F.


:Item( cSchema + "sendusername" ):Value := alltrim(_from)
:Item( cSchema + "sendpassword" ):Value := alltrim(_password)
:Item( cSchema + "smtpconnectiontimeout"):Value := 30

:Update()

END WITH



:Send()
END WITH
RETURN nil

Re: Sample working send mail

Posted: Tue May 17, 2022 1:20 pm
by Romeo
It is strange:

If i use my second mail on tiscali.it it works

Then smtp.tiscali.it works fine for my secondary mail

But smtp.gmailcom doesnt work for my primary mail


It seems that gmail has changed something

Any help on that ?

Grazie

Re: Sample working send mail

Posted: Tue May 17, 2022 1:34 pm
by karinha

Re: Sample working send mail

Posted: Tue May 17, 2022 4:35 pm
by Romeo
I tried it

It doenst work for gmail

Maybe because i have Harbout and not xHarbour ?

Re: Sample working send mail

Posted: Tue May 17, 2022 4:47 pm
by Romeo
My version of FWH is 16.02

:-(

Re: Sample working send mail

Posted: Tue May 17, 2022 5:29 pm
by karinha
https://myaccount.google.com/lesssecureapps?pli=1&rapt=AEjHL4OVmY-ApGYbOoTh57mwGNggo1-hllqACXg8qD_BYdX3CYAn6MNk4CuR95yFG6zcVwUbGvcv3ni1RwKHy_uI_pyZuw5SWA

It will be increasingly difficult to use gmail.com. You don't have a paid account with another provider? The Fivewin version is irrelevant. Although the sooner you upgrade to a more modern version, the better.

Cada vez será más difícil usar gmail.com. ¿No tienes una cuenta paga con otro proveedor? La versión de Fivewin es irrelevante. Aunque cuanto antes actualices a una versión más moderna, mejor.

Regards, saludos.

Re: Sample working send mail

Posted: Wed May 18, 2022 6:16 am
by Jimmy
hi,

i do not use GMail so i can not test it

in Express++ Forum "seems" have a Solution using "UNSAFE APPS" in Settings of the GMAIL account.
http://bb.donnay-software.com/donnay/phpbb3/viewtopic.php?f=15&t=2954&p=18050

but they talk about : this feature expires on 31 May 2022

it seems you have to make new "2-Step Verification" and uses the App Password instead of his GMail Account Password.

Re: Sample working send mail

Posted: Wed May 25, 2022 10:26 am
by Romeo
it really seems doesnt exist a simple solution to continue use gmail mail by fwh

;-(

grazie anyhow

Re: Sample working send mail

Posted: Wed May 25, 2022 10:29 am
by hmpaquito
Hi,

1st. Error description
2nd. ...

Regards

Re: Sample working send mail

Posted: Fri May 27, 2022 11:04 am
by Diego Decandia
One possibility is to install Thunderbird on the user's pc and activate a gmail account.
You send the e-mail as you always have, which is to gmail, and Thunderbird takes care of the rest.

https://support.mozilla.org/en-US/kb/th ... -and-gmail

Re: Sample working send mail

Posted: Wed Jun 01, 2022 3:00 pm
by dutch

Re: Sample working send mail

Posted: Thu Jun 02, 2022 12:48 pm
by Jack
Hello,
I try this and it is working fine with GMAIL .

Try this, hope may help.
viewtopic.php?f=3&t=41496&start=15

Have a good day

Philippe