Sample working send mail

Sample working send mail

Postby Romeo » Tue May 17, 2022 10:23 am

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
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Sample working send mail

Postby Romeo » Tue May 17, 2022 1:20 pm

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
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Sample working send mail

Postby karinha » Tue May 17, 2022 1:34 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Sample working send mail

Postby Romeo » Tue May 17, 2022 4:35 pm

I tried it

It doenst work for gmail

Maybe because i have Harbout and not xHarbour ?
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Sample working send mail

Postby Romeo » Tue May 17, 2022 4:47 pm

My version of FWH is 16.02

:-(
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Sample working send mail

Postby karinha » Tue May 17, 2022 5:29 pm

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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Sample working send mail

Postby Jimmy » Wed May 18, 2022 6:16 am

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.
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Sample working send mail

Postby Romeo » Wed May 25, 2022 10:26 am

it really seems doesnt exist a simple solution to continue use gmail mail by fwh

;-(

grazie anyhow
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Sample working send mail

Postby hmpaquito » Wed May 25, 2022 10:29 am

Hi,

1st. Error description
2nd. ...

Regards
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Sample working send mail

Postby Diego Decandia » Fri May 27, 2022 11:04 am

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
Diego Decandia
 
Posts: 40
Joined: Fri Aug 22, 2014 6:21 am

Re: Sample working send mail

Postby dutch » Wed Jun 01, 2022 3:00 pm

Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Sample working send mail

Postby Jack » Thu Jun 02, 2022 12:48 pm

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
Jack
 
Posts: 280
Joined: Wed Jul 11, 2007 11:06 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 86 guests