Click here to Skip to main content
15,891,764 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,


I need to set a bounce back email when the user failed to send mail to a particular email id.How can set this.Please help me.
regards,
Shefeek
Posted

1 solution

In your mail service program, the mail failure can be captured using exception
MailAddress from, to;
try
{
	MailMessage mailMsg = new MailMessage();
	.........
	SmtpClient smtpClient = new SmtpClient("mailserver", port);
	smtpClient.Send(mailMsg);
}
catch (IOException ex)
{
	MailMessage mailMsg = new MailMessage();
	to = from;
	.........
	smtpClient.Send(mailMsg);	
}


Apparently, the bouncing mail notification can reach the originator.
 
Share this answer
 
Comments
Tech Code Freak 25-Aug-11 23:57pm    
My 5!
shefeekcm 26-Aug-11 2:46am    
is it bounce back when the emailid is incorrect ?
shefeekcm 26-Aug-11 4:47am    
it does not create any exception when the id not correct

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