Here is a problem I can’t seem to be able to pin-point. There have been no changes made to the code for over a year, but it stopped working after I compiled it with Xojo 2025r1 and newer, it seems.
The following code does not send an e-mail to Resend when I run it, neither using SendSync or Sync.
However, if I debug it and step through the code, it works fine. Why is SendSync failing?
URLServer.Disconnect
// Set header
URLServer.ClearRequestHeaders
URLServer.RequestHeader("Authorization") = "Bearer " + K_RESEND_APIKEY
// Assemble the content header
Var oJSON As new JSONItem
oJSON.Value("from") = "noreply@eldr.is"
oJSON.Value("to") = Email.Lowercase.Trim
oJSON.Value("subject") = Subject
oJSON.Value("html") = HTMLBody
// Set the JSON as request content
URLServer.SetRequestContent(oJSON.ToString,K_APPJSON)
// Send the request
return UrlServer.SendSync("POST","https://api.resend.com/emails",10)