Looking for best method error handling bad emails (system.web.mail)

K

Kevin Spencer

The error message indicates that relaying is prohibited. It says nothing
about the user's email address being valid.

Putting a try-catch around it only ignores the error. In other words, no
email is sent; you just don't find out about it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
M

Max

Sometimes I get this error when testing web.mail:
The server rejected one or more recipient addresses
The server response was: 473 (e-mail address removed) relaying prohibited. You should
authenticate first

This goes away when I simply put a try/catch around sending email, but I'm
wondering if I can use this to my advantage -- come back to the user saying
their email is invalid, try again?

I'm asking if this is a good method, since I'm a little bit hesitant to form
my business logic around a try/catch -- I'm under the impression try/catch
is to be used for error handling only.

-Max
 
M

Max

I always get that error when it's an email that doesn't exist. Don't ask me
how it knows... but when I use an email address I know works, it sends just
fine. Maybe it's just an error coming from the SMTP server, in which case
the error would be different depending on the SMTP server it's using...

But you didn't address the question -- I could use try/catch not just to
ignore it, but to return the user back to the form and ask the user to enter
a valid email address. But my concern is that I'm now using try/catch for
actual business logic, not just friendly error message handling.

-Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top