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!
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:
Member
230 Points
685 Posts
Email API not sending
Aug 05, 2015 11:36 AM|RichardLaw|LINK
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:
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
Participant
893 Points
137 Posts
Re: Email API not sending
Aug 07, 2015 05:36 AM|Caillen Zhong|LINK
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