0
Just simply resolve by ,
After the email is sent use Dispose()
method of MailMessage. So here its release all resources and others are disposed here.
And also you can create MailMessage
within using block. As a result all resources will be released (disposed or closed) automatically when execution of the block completes.
using(MailMessage mmEmail = new MailMessage(...))
{
}
I specially like the alternative solution for "USING". and its very popular in the programming end.
Please mark as answer , if it helps you.