dbdp
asked on
Know when mail is sent (using smtpclient in c#)
I am using SMTPClient to send e-mail with a textfile as an attachment
My Code is
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient (sSmtp);
smtp.SendAsync(mail,null);
This works fine however I need to know when the mail is sent to be able to move the text file attachment with out getting the error that the file is being used by another process.
How can I do this?
My Code is
System.Net.Mail.SmtpClient
smtp.SendAsync(mail,null);
This works fine however I need to know when the mail is sent to be able to move the text file attachment with out getting the error that the file is being used by another process.
How can I do this?
Add an event handler to the SendCompleted event.
ASKER
how do I do that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.