How to get the status of sent mail in asp.net c#?

Posted by Prabu_Spark under ASP.NET on 2/5/2013 | Points: 10 | Views : 1496 | Status : [Member] | Replies : 2
Hi sir,
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]


Default.aspx.cs:
*************************

protected void Button1_Click(object sender, EventArgs e)
{
try
{
string fromEmail = ConfigurationManager.AppSettings["Email"].ToString();
string toEmail = txt_toaddress.Text;
MailMessage message = new MailMessage(fromEmail, toEmail);
message.Subject = txt_subject.Text;
message.IsBodyHtml = true;
message.Body = txt_message.Text;

SmtpClient smtp = new SmtpClient();
smtp.Send(message);




}
catch (Exception ex)
{
Response.Write(ex.Message.ToString());
}
}

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: Shubham on: 2/5/2013 [Member] Starter | Points: 25

Up
0
Down
Hi!!!
so what are u doing you sent mail from your code or you want to status of ur sent mail!!!!

because this above u written is send mail code.

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raj.Trivedi on: 2/21/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello Prabhu,

If you have sent the email and if you dont retrieve a delivery failure that means you have successfully sent the mail,

The above code that is pasted is actually for sending emails

Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response