1. Catherine Ryan
  2. PowerBuilder
  3. Thursday, 8 March 2018 09:19 AM UTC

Hi all,

I am having an issue with PBNISMTP in PB2017. The same code works fine in PB12.0 - in the same environment (running on the same machine, using same email server etc…). The issue occurs in both the 2017 IDE and EXE.

As far as I can tell we have all the PB17 dlls in place and I successfully imported the pbnismtp2017.pbx into my PB2017 project. I also copied it into the Program Files(x86)\Appeon\Shared folder and our application directory.
Interestingly it’s when I get to the last line in my code (the Send function) that it throws the PBXRuntime error (Error calling method of a PBNI object). So it’s executing the rest of it ok.
l_smtp = CREATE n_cpp_smtp
l_smtp.SetErrorMessagesOff()
l_smtp.SetRecipientEmail (ls_email )      
l_smtp.SetSenderEmail ( ls_sender )
l_smtp.SetSubject (ls_subject )
l_smtp.SetMessage ( ls_message, True )
l_smtp.SetSMTPServer ( ls_server)
//Send the email
li_rc = l_smtp.Send ( )

Any ideas why the Send function may be causing this error?
I've tested it in 2 different environments in both PB12 and PB17 - 12 works fine every time and 17 gives the same error every time.
Any help/thoughts appreciated!

Catherine

Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 8 March 2018 13:37 PM UTC
  2. PowerBuilder
  3. # 1

Try downloading PBNISMTP from here:

http://www.topwizprogramming.com/pbnismtp.html

PBNISMTP was originally written by Bruce Armstrong. I added some new features and updated it to a newer version of the SMTP class. I also removed version number from the file name as none of the code is version dependent.

Give this a try and if you have any issues, you can reply here or the topwizprogramming Facebook page.

Comment
  1. Milton Jiménez
  2. Thursday, 3 March 2022 15:17 PM UTC
Hi,Roland,I am using pbnismtp It is working on most PCs with w10 and also with wserver 2016, except on a server with windows server 2016,

li_rc = l_smtp.Send ( )

it returns me li_rc= - 4 , connection server closed correctly ,

I use the same configuration parameters and account but I can't send



Any help/thoughts appreciated!



thanks

regards,



  1. Helpful
  1. Roland Smith
  2. Thursday, 3 March 2022 18:00 PM UTC
Windows Server 2016 reached end of mainstream support Jan 11, 2022. Like Windows 7, it does not support the security features needed to send email to your server.
  1. Helpful
  1. Milton Jiménez
  2. Thursday, 3 March 2022 18:23 PM UTC
ok thanks,
  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.