473,748 Members | 4,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 1773
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*****@portvi sta.com> wrote in message
news:Zx******** *************@t wister.tampabay .rr.com...
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******@takem pis.com> wrote in message
news:eZ******** ******@TK2MSFTN GP09.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*****@portvi sta.com> wrote in message
news:Zx******** *************@t wister.tampabay .rr.com...
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
2585
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 functions must return an error code of a standard type, for example tError. Where tError is typedefed as a long int. A list of error codes may then be defined in a global header file, or perhaps upper bits of tError may indicate a module
2
2548
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; // hard-coded mail.To = platypus@somewhere.com; mail.Subject = "Test"; mail.Body = strMessage;
2
9241
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 - I see hebrew, it is just sending by myself using *.aspx scripts). In web.config I have the following : <configuration> <system.web>
2
2209
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 delay to load the page for about 10 seconds followed by the : The transport failed to connect error. using the following code to email: SmtpMail.Send(mail)
2
2957
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 occurred: System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8004020F): The...
2
2143
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 session variables from Application_Error event, but I need to so I don't need to set up traces to see what they are during an error. I am emailing the error condition to myself when it happens.
6
3957
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: p_TableName, p_OrderBy, p_MaxRows, p_PageNum, p_StartRowIndex." I have a gridview associated to an ObjectDataSource and the ObjectDataSource is declared in the aspx file as follows:
5
1735
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 procedure and connection string as a path. My method returns a dataset. In my SP i have an output parameter which tells me whether the SP select is successful or not. If i get a error code passed back then i throw an exception this then returns...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.