I am using the .NET SmtpClient class to send an email from an AppServer procedure. I have implemented some simple code to test, based on the syntax found here: https://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient(v=vs.110).aspx
All of the OpenEdge syntax is correct (using the class browser, it is simple to translate the code), but the problem line is here:
mailClient:send(mailMessage).
When running the code the following error is shown:
You are trying to use a multi-threaded .NET object in a way that is not supported. The ABL cannot be called on a thread other than the main thread. (15740) The ABL is single threaded. You will see this error if you use a .NET object that employs multiple threads and attempts to call back to the ABL on a thread other than the main processing thread.
My question is how do you use a multi-threaded .NET object in ABL since it is single threaded.
Initially documentation suggested using the WAIT-FOR statement, however this did not change the result.
sendmethod is not async, there is a specialSmtpClient.SendAsyncmethod for that, also many other methods with a prefixAsync!? - xander