Hello,
I am currently evaluating SmarterMail with the Free license before moving forward with a purchase.
As part of the testing, I am developing an API integration for sending and receiving mail. Receiving works without issues, but I am running into a problem when sending mail using the SendMessage API.
Environment: ASP.NET C#
The problem is that regardless of which parameters I include in the request, the API always responds with:
var mailData = new { to = "\"test@receive.com\" <test@receive.com>;", ownerEmailAddress = "send@test.com", from = "send@test.com", subject = "test", messageHTML = "test" };
I have checked the community forum, but I have not been able to find a post that addresses this specific error.
Could you please advise what might be causing this?
Is there an issue with the request payload format?
Or is there a domain/mailbox configuration setting in SmarterMail that I need to adjust?
The API documentation does not provide enough information for me to determine the cause. Any guidance or suggestions would be greatly appreciated.
Thank you.
By reporting abuse, a moderator will be asked to review the content of this interaction to take further action, if necessary.
Thank you for your response. However, I am still encountering the same error.
Just in case it helps, I am also attaching the HTTP request code below.Here is the code I am using to make the request.
using (var client = new HttpClient()) { var mailData = new { to = "test@receive.com", ownerEmailAddress = "send@test.com", from = "send@test.com", subject = "test", messageHTML = "test" }; var json = JsonConvert.SerializeObject(mailData); var content = new StringContent(json, Encoding.UTF8, "application/json"); client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); var response = client.PostAsync(uri, content).Result; dynamic result = JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); if (!response.IsSuccessStatusCode) { throw new Exception($"Sending message failed with status code {response.StatusCode} / {result.message}"); } return result; }
result.message
selectedFrom
selectedFrom = ":test@test.com"
A code was sent to the recovery email address. Please provide the 6-digit code.
A code can be retrieved from your authentication app. Please provide the 6-digit code.
An email was sent to your recovery email address. If you need further assistance, please contact your system admin.
Passkeys let you sign in quickly and securely using your fingerprint, face, or device PIN. No password needed!