Solved

mail validate

Posted on 2011-03-09
7
286 Views
Last Modified: 2012-05-11
Dear Team,

I m sending mail after my insert query but i want to delete my inserted record if my mail will not send.
How can i check my main delivered to receipent.

Please let me know.
0
Comment
Question by:virafh
7 Comments
 
LVL 8

Expert Comment

by:vsudip
ID: 35080730
0
 
LVL 14

Expert Comment

by:robasta
ID: 35080817
There's no way to be 100% sure that a mail message has been received when sent via SmtpClient due to the way email works. The fact that SmtpClient doesn't throw an exception essentially means that you've done everything right, but a failure can happen further down the line, for example:

The receiving mail server could reject the mail
An intermediate mail server could reject the mail
The server that SmtpClient is transmitting mail through could decide to refuse to transmit the mail

use a try-catch like:

try
{
smtpClient.Send(emailMessage);
}
catch(Exception ex)
{
 // did not send (delete record) >> delete my inserted record if my mail will not send
}


see discussion here:
http://stackoverflow.com/questions/4973725/how-to-check-mailmessage-was-delivered-in-net
0
 

Author Comment

by:virafh
ID: 35081058
Dear robasta:

Thanks for ur response i am already using the try catch it is working fine.

But suppose someone typing abc@abc.com than try catch statement will validate this id.

I want if any user put any dummy id on that time our code validate.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 14

Accepted Solution

by:
robasta earned 250 total points
ID: 35081194
see here: http://www.codeproject.com/KB/validation/Valid_Email_Addresses.aspx

under: Validating via SMTP Handshakes

there is some sample code
0
 

Author Comment

by:virafh
ID: 35081329
thanks robasta i think your provided code will work for me
0
 
LVL 19

Expert Comment

by:Amandeep Singh Bhullar
ID: 35944472
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now