Click here to Skip to main content
15,878,945 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing .net application where in three operations are to be performed at one go. At first, record is to be inserted into table, then first mail is to be send to admin and second mail is to be send to user who fills form.. I am not sure as to how can these three operations can be performed successfully. If first two operations are completed and last operation is not able to complete, then it must rollback. I am thinking of using transaction to do so and roll back using try catch exception if any of the operation is not complete. But my doubt is if record is inserted and first mail is send and mail send failure occurs in second mail send, is the first mail send rollbacked !!! is there another method to do so???
Posted
Comments
Peter Leow 5-Jun-14 3:39am    
Apparently, mail that was sent cannot be undone, that is beyond the scope of transaction. However, you can notify the admin through another mail about the failure during rollback.
Codes DeCodes 5-Jun-14 5:43am    
thans for your knowledge and logic.. will try that

Apparently, mail that was sent cannot be undone, that is beyond the scope of transaction. However, you can notify the admin through another mail about the failure during rollback.
 
Share this answer
 
Unfortunately you cannot unsend the email message. I suggest you search for a 3rd party product that can queue emails and perhaps use that or instead add a notification feature if one of the emails fails.
 
Share this answer
 

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