1. Julian I.
  2. PowerBuilder
  3. Monday, 30 October 2023 15:19 PM UTC

Hi,

We are using the PBNISMTP object (pbnismtp.pbx) to send emails using SMTP. We are experiencing delays and sometimes timeout issues when sending emails. The server provider has detected a problem in its infrastructure and is trying to fix it. In the meantime, we believe that the server connection timeout is set to 60 seconds and the question is: do you know if it is possible to reduce the timeout in the pbnismtp object?

Greetings,


Julian.

Julian I. Accepted Answer Pending Moderation
  1. Tuesday, 31 October 2023 09:39 AM UTC
  2. PowerBuilder
  3. # 1

Hi,

Thanks !, my knowledge of c++ is very basic but the change seems easy. I am going to investigate how to create a new function to set the timeout and how to rebuild the pbx.

Regards.

Comment
  1. Andreas Mykonios
  2. Tuesday, 31 October 2023 10:10 AM UTC
By the way, I saw that you are using PB 2019, but you didn't mention the exact release. R2 introduced .NET DLL Importer. When we had to send mails, we developed a simple class in C#, implementing all our requirements. We then used the produced dll to be able to send mail via smtp. C# code may be easier to maintain, and is easier to read compared to C++.

Andreas.
  1. Helpful 3
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 31 October 2023 07:12 AM UTC
  2. PowerBuilder
  3. # 2

Hi.

From what I saw, in PJNSMTP.cpp there is the following code:

#pragma warning(suppress: 26455)
CPJNSMTPConnection::CPJNSMTPConnection() : m_ConnectionType{ConnectionType::PlainText},
                                           m_bConnected{false},
                                           m_bDoEHLO{true},
                                           m_dwTimeout{60000},
                                           m_nLastCommandResponseCode{0},
                                           m_SSLProtocol{SSLProtocol::OSDefault},
                                           m_bCanDoDSN{false},
                                           m_bCanDoSTARTTLS{false},
                                           m_bCanDoSMTPUTF8{false},
                                           m_bDoInitialClientResponse{false},
                                           m_bUsePunyCode{true}

I don't believe that timeout setting is exposed. Currently it is hardcoded to 60 seconds as you correctly concluded. So I guess you would need to change it directly to c++ and recompile the project, or somehow expose that option to powerbuilder.

Andreas.

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 30 October 2023 16:19 PM UTC
  2. PowerBuilder
  3. # 3

Hi, Julian -

According to SMTPClient object documentation, there is a Timeout property for a Send call:

    https://docs.appeon.com/pb2022r2/objects_and_controls/SMTPClient_object.html#d0e63605

Best regards, John

Comment
  1. John Fauss
  2. Monday, 30 October 2023 18:04 PM UTC
Thanks, Chris - I obviously missed that important point. More caffeine, stat!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 30 October 2023 18:36 PM UTC
Don't worry John ... I suffer from low caffeine quite often - LoL!
  1. Helpful
  1. Julian I.
  2. Monday, 30 October 2023 20:02 PM UTC
Thank's to all !, Yes, we are using the latest version of the object from Roland Smith's in "TopWiz" site. Our PB Version is 2019, so we don´t have new features of pb SMTPClient object. We are pending to migrate new pb versión.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.