I am trying to change my code from using the PBNISMTP library to the built-in SMTPClient object with the latest version of PowerBuilder 2022 R3 build 3391. The PBNISMTP library works fine when I run it through the IDE but the compiled version crashes with a fatal error. Changing the code to SMTPClient causes a timeout Error.
The SMTPClient settings are pretty vanilla where I am using an SSL connection with port 465, but there is no equivalent in the SMTPClient class, at least not one I can see.
Can someone help with this?
Thanks,
Ed
integer li_rc
SMTPClient lnv_SmtpClient
lnv_SmtpClient = CREATE SMTPClient
lnv_SmtpClient.Host = "my.mailserver.com"
lnv_SmtpClient.Port = 465
lnv_SmtpClient.Username = "MyUser@mailserver.com"
lnv_SmtpClient.password = "mypassword"
lnv_SmtpClient.SetProxy("",0)
lnv_SmtpClient.EnableTLS = True; //False or True returns the same result
lnv_SmtpClient.SecureProtocol = 1 //Regardless of the value the result is the same
lnv_SmtpClient.Timeout = 30
lnv_SmtpClient.Message.SetSender("myuser@mailserver.com", "user name");
lnv_SmtpClient.Message.AddRecipient("myfriend@gmail.com", "friend name");
lnv_SmtpClient.Message.Subject = "Subject of my email"
lnv_SmtpClient.Message.HTMLBody = "Body of my email"
lnv_SmtpClient.Message.Priority = 0 //Normal
lnv_SmtpClient.Message.AddAttachment("c:\temp\myattachment.pdf")
lnv_SmtpClient.Message.Encoding = "UTF-8"
// send the email
li_rc = lnv_SmtpClient.Send()
**** Result is that li_rc is -11
As for the pbnismpt question, I compile to x32 but I believe it's the same error with x64.