locked
Email API not sending RRS feed

  • Question

  • User1953081067 posted

    Hi,

    I've been using a web API to send emails that's been working perfectly for months. Now it's not.

    The only error I get is 'Failure sending mail.' when using:

    msg = messageDefinition.CreateMailMessage(HttpUtility.HtmlEncode(emailrecipients), replacements, new LiteralControl());

    I'm guessing it's a problem with the SMTP server, but is there a anyway to get a more meaningful error? I'm using a shared server so do not have access to IIS - only a help desk!

    Any thoughts?

    Thanks as always

    Wednesday, August 5, 2015 11:36 AM

Answers

  • User438962230 posted

    I'm guessing it's a problem with the SMTP server, but is there a anyway to get a more meaningful error? I'm using a shared server so do not have access to IIS - only a help desk!

    Hi RichardLaw,

    To make sure if the SMTP server is ok, I think you can use some SMTP client to test it, search "SMTP client", you may get many results. To get the meaningful error message, you can try to analyze the exception message and stacktrace in your code, catch the specified exception and return your custom meaningful error message. To get all the probable exception, check the documentation in MSDN:

    https://msdn.microsoft.com/en-us/library/0002kwb2(v=vs.110).aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 7, 2015 5:36 AM