send mail

send mail

Postby damianodec » Wed Jun 07, 2017 3: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: Select all  Expand view  RUN
 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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: send mail

Postby James Bott » Wed Jun 07, 2017 6: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: send mail

Postby damianodec » Thu Jun 08, 2017 6:25 am

thank you James
is there any other way?
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: send mail

Postby damianodec » Thu Jun 08, 2017 8: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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: send mail

Postby karinha » Thu Jun 08, 2017 12:49 pm

use google translator please:

Image

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

Re: send mail

Postby James Bott » Thu Jun 08, 2017 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: send mail

Postby James Bott » Thu Jun 08, 2017 2: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: send mail

Postby Rick Lipkin » Thu Jun 08, 2017 3: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
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: send mail

Postby damianodec » Fri Jun 09, 2017 7: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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: send mail

Postby James Bott » Fri Jun 09, 2017 4: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: send mail

Postby damianodec » 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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: send mail

Postby James Bott » Mon Jun 12, 2017 3: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 35 guests