Page 1 of 1

send mail

Posted: Wed Jun 07, 2017 3:22 pm
by damianodec
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

 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?

Re: send mail

Posted: Wed Jun 07, 2017 6:28 pm
by James Bott
You could create a generic GMail account just for this and then email from that account via SMTP.

James

Re: send mail

Posted: Thu Jun 08, 2017 6:25 am
by damianodec
thank you James
is there any other way?

Re: send mail

Posted: Thu Jun 08, 2017 8:12 am
by damianodec
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?

Re: send mail

Posted: Thu Jun 08, 2017 12:49 pm
by karinha
use google translator please:

Image

Regards, saludos.

Re: send mail

Posted: Thu Jun 08, 2017 1:46 pm
by James Bott
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

Re: send mail

Posted: Thu Jun 08, 2017 2:14 pm
by James Bott
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

Re: send mail

Posted: Thu Jun 08, 2017 3:32 pm
by Rick Lipkin
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

Re: send mail

Posted: Fri Jun 09, 2017 7:16 am
by damianodec
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...

Re: send mail

Posted: Fri Jun 09, 2017 4:12 pm
by James Bott
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

Re: send mail

Posted: Mon Jun 12, 2017 11:52 am
by damianodec
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

Re: send mail

Posted: Mon Jun 12, 2017 3:20 pm
by James Bott
Daminao,

Perhaps this page will help:

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

Regards,
James