Click here to Skip to main content
15,891,674 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi!!!
Tell me the steps to get the status of sent mail in asp.net c#. Kindly give me the solution for this problem. I attached
the code below for further details.



Hint: If i sent mail to one email id, i want to get the status of sent email
Posted
Comments
Pete O'Hanlon 5-Feb-13 8:25am    
Nope. I can't see any code there. You might want to add it in.
Ankur\m/ 5-Feb-13 8:29am    
If I am getting your question right, have a flag against the record that your sending mail for in your database. Default it to false and set it to true if the mail gets sent successfully.

If you don't receive any exceptions in your code or on your SMTP server, you can assume that it has been delivered. That is a problem with e-mail, there is no way to guaranteeing delivery.
 
Share this answer
 
 
Share this answer
 
C#
SmtpClient SmtpServer = new SmtpClient();
SmtpServer.Credentials = new Net.NetworkCredential("xyz@gmail.com", "password");
SmtpServer.Port = 587;
SmtpServer.Host = "smtp.gmail.com";
SmtpServer.EnableSsl = true;

mail = new MailMessage();
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
mail.ReplyTo = new MailAddress(TextBox1.Text);
SmtpServer.Send(mail);


This is for SMTP Delievry Response
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900