Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Participant
1331 Points
263 Posts
May 02, 2010 12:25 PM|LINK
To confirm whether or not your email message was sent out from your SMTP server, you can do something like this. Getting email read notification option is done by adding a custom header called "Disposition-Notification-To" to the mail message:
protected void btnSendEmail_Click(object sender, EventArgs e) { MailMessage msg = new MailMessage(); SmtpClient client = new SmtpClient();
//Add a custom header called Disposition-Notification-To to the mail message:
msg.Headers.Add("Disposition-Notification-To", "email address");
try
{ client.Send(msg); Response.Write("Your mail was sent."); } catch (SmtpException ex)
{ Response.Write(ex.Message); } }
compguy2100
Participant
1331 Points
263 Posts
Re: How can I know that an e-mail was successfully sent?
May 02, 2010 12:25 PM|LINK
To confirm whether or not your email message was sent out from your SMTP server, you can do something like this. Getting email read notification option is done by adding a custom header called "Disposition-Notification-To" to the mail message:
protected void btnSendEmail_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
SmtpClient client = new SmtpClient();
//Add a custom header called Disposition-Notification-To to the mail message:
msg.Headers.Add("Disposition-Notification-To", "email address");
try
{
client.Send(msg);
Response.Write("Your mail was sent.");
}
catch (SmtpException ex)
{
Response.Write(ex.Message);
}
}
Thank you!