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"
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add noreply@smartertools.com to your trusted senders list in your email software.