Sample working send mail

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

Sample working send mail

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

Re: Sample working send mail

Post 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
User avatar
karinha
Posts: 7935
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Sample working send mail

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Romeo
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Sample working send mail

Post by Romeo »

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

Post by Romeo »

My version of FWH is 16.02

:-(
User avatar
karinha
Posts: 7935
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Sample working send mail

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: Sample working send mail

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

Re: Sample working send mail

Post by Romeo »

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

;-(

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

Re: Sample working send mail

Post by hmpaquito »

Hi,

1st. Error description
2nd. ...

Regards
Diego Decandia
Posts: 40
Joined: Fri Aug 22, 2014 6:21 am

Re: Sample working send mail

Post 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
User avatar
dutch
Posts: 1554
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Sample working send mail

Post by dutch »

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

Re: Sample working send mail

Post 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
Post Reply