FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour send mail
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
send mail
Posted: Wed Jun 07, 2017 03:22 PM
hi,
I need this.
I have a lan with 4 pc, I'd like to send from my app.exe a email when user insert a new product.
users have their email but with different extensions (usr1@gmail.com, usr2@mydominio.it, usr3@tiscali.it, etc)
I configured inside my.prg CDO.Message with gmail smtp
Code (fw): Select all Collapse
  WITH OBJECT oEmailCfg:Fields
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ):Value             := Alltrim(cServer) // "smtp.gmail.com"
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ):Value         := nPOrta // 465
     :Item( "http://schemas.microsoft.com/cdo/configuration/sendusing" ):Value              := 2   // Remote SMTP = 2, local = 1
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ):Value       := .t.
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpusessl" ):Value             := lSSL
     :Item( "http://schemas.microsoft.com/cdo/configuration/savesentitems" ):Value          := lSave
     :Item( "http://schemas.microsoft.com/cdo/configuration/sendusername" ):Value           := AllTrim(cSender)  //  "usr1@gmail.com"
     :Item( "http://schemas.microsoft.com/cdo/configuration/sendpassword" ):Value           := AllTrim(cPass) // Password of usr1
     :Item( "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"):Value   := 60
     :Update()
  END WITH

when I used this settings from pc of user with usr1@gmail.com (in this pc there is Thunderbird) email work perfect but if I use my app.exe from pc of user with usr2@mydominio.it I get error.
I know that it's chained with thunderbird configuration but I'd like unchained email from smtp client.
I'd like to send email from all pc using always a general settings.
is it possible?
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: send mail
Posted: Wed Jun 07, 2017 06:28 PM

You could create a generic GMail account just for this and then email from that account via SMTP.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: send mail
Posted: Thu Jun 08, 2017 06:25 AM

thank you James
is there any other way?

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: send mail
Posted: Thu Jun 08, 2017 08:12 AM

i try to send from other pc using the same gmail configuration of usr1@gmail.com but I get this error:
COULD NOT SEND MESSAGE
ERROR 1001.0000
SuBC 65535.0000
OSCODE 0.0000
SubSystem: TOLEAuto
Message:

any help?

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: send mail
Posted: Thu Jun 08, 2017 12:49 PM
use google translator please:



Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: send mail
Posted: Thu Jun 08, 2017 01:46 PM

Damiano,

Every mail system has it's own configuration for their SMTP server. Most businesses have one mail system for all their employees so this is simple. In your case each one has a different mail system, so there are only two choices. 1) Change the configuration for each person's outgoing email, or 2) create a new email just for this and use it for everyone to send these notices. Many companies use this type of email account for sending out invoices, payment reminders, sales letters, etc.

One other possibility that just came to mind, is to add a simple message system to your app that is all local (that doesn't even use email). This would be more work though.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: send mail
Posted: Thu Jun 08, 2017 02:14 PM

Damiano,

I just had another idea. If all your users are running Windows 10, then you can use the Toast notifications. If you are interested, search the forum for "toast."

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: send mail
Posted: Thu Jun 08, 2017 03:32 PM

Damiano

James brings up a good point .. if you are in a corporate setting and are trying to send out SMTP thru the Corporate infrastructure .. I know for a fact, that many Corporate IT policies forbid SMTP traffic out or within their Corporate routers and block that type of traffic.... without prior permission and exceptions made in their router for that particular machine name.

If that is the case and your customer is in a Corporate setting .. I would find out if that Company has specific policies in place to block SMTP traffic within their infrastructure.

Rick Lipkin

Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: send mail
Posted: Fri Jun 09, 2017 07:16 AM

hi, thank for your help.
Situation is this.
In this company there are about 60 users (win 7, win10, old XP...) and ibm iSeries server. Inside iSeries there are my applications (in RPG language). there are about 20 pc with my FWH app that read data from DB2 and show dashboards and statistics or export to excel.
This company have your domain http://www.thiscompany.it and users have their email usrs@thiscompany.it.
there are about 15 external collaborators (inside and outside company lan) that have their email ...@gmail.com, ...@tiscali.it, ...@hotmail.it, ...@etcetc.com, ...@others.com.
On my PC (inside company with win10) I have Thunderbird with myemail@gmail.com SMTP configuration (smtp.gmail.com, port 465, 2 remote) and If I send email from sendmail.pgm (myexe.exe) using CDO.Configuration that's ok All users receive my email, it works!
But If I use myexe.exe on anothers pcs (win7 32bit or win7 64bit) and configure thunderbird with the same myemail@gmail.com with the same SMTP configuration I get ERROR 1001.0000 etc...

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: send mail
Posted: Fri Jun 09, 2017 04:12 PM
But If I use myexe.exe on anothers pcs (win7 32bit or win7 64bit) and configure thunderbird with the same myemail@gmail.com with the same SMTP configuration I get ERROR 1001.0000 etc...


OK, if you are using CDO instead of MAPI I don't think it has anything to do with Thunderbird. Or, maybe you are saying the even Thunderbird does not work on those PCs?

Possibly those PC's that are erroring out have a different version of CDO or it is not registered correctly. Do you know what error 1001.0000 means?

Also, the firewall on those PCs may be blocking the port you are trying to use.

I suggest searching the net for CDO errors.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: send mail
Posted: Mon Jun 12, 2017 11:52 AM

hi James,
I found Microsoft CDO error 1001. It seems that when CDO not works errors could be inside windows registry (regdet32) keys.

Im trying

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: send mail
Posted: Mon Jun 12, 2017 03:20 PM

Daminao,

Perhaps this page will help:

https://support.microsoft.com/en-us/hel ... and-cdonts

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion