Link to home
Start Free TrialLog in
Avatar of dbdp
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?
Avatar of Die-Tech
Die-Tech

Add an event handler to the SendCompleted event.
Avatar of dbdp

ASKER

how do I do that?
ASKER CERTIFIED SOLUTION
Avatar of Die-Tech
Die-Tech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial