-
Tim Harvey
- PowerBuilder
- Tuesday, 20 January 2026 08:40 PM UTC
Environment:
PowerBuilder: 2022 R3 Build 3441
OS: Windows 11
I am encountering a strange behavior with the SmtpClient object. The Send() function returns -13, which the documentation defines as "Failed to send the network data."
The failure only occurs when the recipient string is retrieved from a database (Sybase).
The scenario:
I retrieve a semicolon-delimited string of emails from the database (e.g., test@test.com;test2@gmail.com).
I parse these in a loop using Pos and Mid.
For each email, I call lnv_SmtpClient.Message.AddRecipient(ls_email).
AddRecipient returns 0 (Success) for every address.
Upon calling lnv_SmtpClient.Send(), I immediately get -13.
What I have tried:
Used Trim() on the parsed strings.
Manually removed ~r, ~n, and ~t characters using Replace.
Tested the exact same code with, pulling 2 seperate email addresses and concat them into one string - Works
Tested the exact same code using only one email address from the same db field - Works
Questions:
Is there a way to trace the raw SMTP "conversation" in PB 2022 R3 since LogFile is not a property of SmtpClient?
Does AddRecipient perform full validation, or is it possible for a malformed string to pass AddRecipient but break Send()?
Are there known issues with Unicode/UTF-16 strings from the DB being passed to the SmtpClient?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.