473,322 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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

Max
Sometimes I get this error when testing web.mail:
The server rejected one or more recipient addresses
The server response was: 473 kj**@Kjhg.com 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
Nov 18 '05 #1
2 1753
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.

"Max" <ma*****@portvista.com> wrote in message
news:Zx*********************@twister.tampabay.rr.c om...
Sometimes I get this error when testing web.mail:
The server rejected one or more recipient addresses
The server response was: 473 kj**@Kjhg.com 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

Nov 18 '05 #2
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

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:eZ**************@TK2MSFTNGP09.phx.gbl...
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.

"Max" <ma*****@portvista.com> wrote in message
news:Zx*********************@twister.tampabay.rr.c om...
Sometimes I get this error when testing web.mail:
The server rejected one or more recipient addresses
The server response was: 473 kj**@Kjhg.com 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


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Spacen Jasset | last post by:
The main two desirable things I feel error handling should provide are these: 1) Debugging and diagnostic aid 2) User feedback One method that is used a fair amount it to 'say' that all...
2
by: Leszek | last post by:
Hello, I have created a simple code to send emails using the MailMessage class and the SmtpMail.Send() method: MailMessage mail = new MailMessage(); mail.From = echidna@somewhere.com; //...
2
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends -...
2
by: jason | last post by:
I discovered this morning that a few of my sites have routines to automatically email when pages are accessed. These pages were down becuase the the smtp server I'm using was down. I would see a...
2
by: Chris Rennie | last post by:
I've developed an application that is using the System.Web.Mail namespace and have run into a rather interesting problem. The aforementioned error displays this: The following exception...
2
by: tshad | last post by:
This has been driving me crazy. I have been trying to get the error handling working on my system and can get parts of it working and others won't work at all. I found that you can't access...
6
by: miky | last post by:
Hi, I'm trying to get custom gridview paging working and I'm getting the following error: "ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'count' that has parameters:...
5
by: csgraham74 | last post by:
Hi guys, Basically i have been developing in dotnet for a couple of years but ive had a few issues in regards to error handling. For example - I have a class that i call passing in a stored...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.