PxPlus User Forum

Twitter Twitter Twitter

Author Topic: *web/email not working with PxPlus Webserver  (Read 544 times)

ksproul

  • Silver Member
  • ***
  • Posts: 21
    • View Profile
*web/email not working with PxPlus Webserver
« on: April 18, 2019, 12:38:29 PM »
I have a PxPlus Webserver background process with a web request program that uses *web/email to send emails from the server.  If I substitute it with *web/mail, the email is sent with no problem.

The message I'm getting from *web/email is:
Sending to SMTP Server Failed: (0): Connect to SMTP Server: unc-address;25 timed out. (0/115).

So why is *web/email having this problem and *web/mail is not?  Any help will be appreciated.
Ken Sproul
DPI Information Services, Inc.

Devon Austen

  • Staff
  • Diamond Member
  • *****
  • Posts: 207
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: *web/email not working with PxPlus Webserver
« Reply #1 on: April 18, 2019, 01:42:09 PM »
Hi Ken,

If you are using PxPlus 2016 or newer you can try to use the *web/testemail utility.

CALL "*web/testemail;test_name",from$,smtp_server$,username$,password$,to$

This will allow you to do a very simple test of *web/email. If it works it will display the *web/email command it used. This helps make sure you are calling it correctly. If it doesn't work it lets you know that none of the extra options are to blame.

The difference between the two programs I believe is that *web/email is our full featured email utility while *web/mail is a older simple bare bones utility. It is possible that a difference in how they are implemented is why one works but one doesn't.

The *web/mail program has a 20 second timeout. While *web/email uses whatever timeout you specify. If not specified passed in as 0 then it defaults to 60 seconds. Are you passing in a value to *web/email less than 20 for timeout?
Software Developer for PVX Plus Technologies LTD.

ksproul

  • Silver Member
  • ***
  • Posts: 21
    • View Profile
Re: *web/email not working with PxPlus Webserver
« Reply #2 on: April 19, 2019, 06:15:27 PM »
In this case it is not PxPlus 2016.  We actually have another background process on the same server executing the same code that the webserver process is executing and the *web/email call works perfectly in that process.  So it's something different about the webserver process that I cannot figure out.  I'm passing all the same values in the *web/mail call for the equivalent arguments of the *web/email call.  I'm not passing any timeout value to *web/email and it's taking the full 60 seconds to fail based on the time stamps of the logging that we're doing.

This really is perplexing because it's a very simple text/html email with the server address, port 25 specified, from address, reply address same as from, one to address, a subject, and a very short message.  No authentication, ssl, cc addresses, bcc addresses, or attachments.
Ken Sproul
DPI Information Services, Inc.

Devon Austen

  • Staff
  • Diamond Member
  • *****
  • Posts: 207
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: *web/email not working with PxPlus Webserver
« Reply #3 on: April 22, 2019, 09:40:08 AM »
I would look at the documentation for *web/email (https://manual.pvxplus.com/?Web%20Utilities/Email%20Utility/Overview.htm) carefully and make sure you are calling it correctly. It is fairly common to get one of the arguments wrong and that can cause issues.

Another possibility is internet security or antivirus software blocking the process from connecting.
Software Developer for PVX Plus Technologies LTD.

ksproul

  • Silver Member
  • ***
  • Posts: 21
    • View Profile
Re: *web/email not working with PxPlus Webserver
« Reply #4 on: April 25, 2019, 08:09:03 AM »
The exact same *web/email call works outside of the webserver process.  This exact same code is executed in another background process with no issue. It has something to do with the webserver background environment, just not sure what that could be.  If *web/mail works, *web/email should also work.  It would be nice to know what it is doing differently that would cause the error 0.
Ken Sproul
DPI Information Services, Inc.

Devon Austen

  • Staff
  • Diamond Member
  • *****
  • Posts: 207
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: *web/email not working with PxPlus Webserver
« Reply #5 on: April 25, 2019, 08:48:53 AM »
What user is the webserver process being run as? Does that user have the correct firewall settings?
Software Developer for PVX Plus Technologies LTD.

EVa

  • Member
  • **
  • Posts: 18
    • View Profile
    • EDIAS
Re: *web/email not working with PxPlus Webserver
« Reply #6 on: April 25, 2019, 09:13:47 AM »
The error message indicates that a simple open of "[tcp]unc-address;25" doesn't work (or "[tcp]unc-address;25;secure" if you specified -secure) and results in an error 0.  Can you create a simple web program that tries to do that open ?