Naveen Kumar Kaushik

Naveen Kumar Kaushik

  • NA
  • 421
  • 67.5k

How I can track Email send or Not Through Asp .Net?

May 8 2013 2:19 AM
Hi all,
I've Written a code for email send in asp .net but i want to track the email record email send on the other end or not.
Here is my EmailSend code:-
public void Sendmail(string ECandidateName)
{
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress("Email Address", "Name");
smtpClient.Host = "smtp.gmail.com";
smtpClient.Port = 587;
message.From = fromAddress;
message.To.Add(txtEmail.Text);
message.Subject = "Thank you for your Connecting Us";
message.Bcc.Add("emailid");
message.Bcc.Add(new MailAddress("Emailid"));
message.IsBodyHtml = false;
message.Body = "Thnks for Request"
smtpClient.Credentials = new System.Net.NetworkCredential("EmailId", "Password");
smtpClient.EnableSsl = true;
smtpClient.Send(message);
 
// lblStatus.Text = "Email successfully sent.";
}
catch (Exception ex)
{
Response.Write("<script>alert('"+ex.Message+"')</script>");
// lblStatus.Text = "Send Email Failed.
" + ex.Message;
}
}

 

}
this code is working fine but some times it doesn't send the email to particular address which I've mention in To option.I want to track the email if the email is send or not towards the receivers end
Thanks,
Regards
Naveen

Answers (1)