I am doing an email form. Email has attachments and after attaching files email is sent. Next there is requirement to delete file from server. When I tried to get the file i
After execute "SendMessageGmail", free the attachment of MailMessage.Attachments by iterating.
SendMessageGmail(oMess);
if(oMess.Attachments != null) {
for(Int32 I = oMess.Attachments.Count - 1; I >= 0;I--) {
oMess.Attachments[i].Dispose();
}
oMess.Attachments.Clear();
oMess.Attachments.Dispose();
}
oMess.Dispose();
oMess = null;