Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 5-Feb-13 2:22am
Comments
Pete O'Hanlon at 5-Feb-13 8:25am
   
Nope. I can't see any code there. You might want to add it in.
Ankur\m/ at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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.
  Permalink  

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

  Print Answers RSS
0 Maciej Los 450
1 OriginalGriff 403
2 Sergey Alexandrovich Kryukov 199
3 CPallini 189
4 CHill60 180
0 OriginalGriff 6,092
1 Sergey Alexandrovich Kryukov 4,972
2 Maciej Los 3,269
3 Peter Leow 3,129
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100