I file vengono allegati alla mail così:
poi spedisco la mailcodice:If Session("CompletePathFile1") <> "" Then mail.Attachments.Add(New Attachment(Session("CompletePathFile1"))) End If If Session("CompletePathFile2") <> "" Then mail.Attachments.Add(New Attachment(Session("CompletePathFile2"))) End If
Server.Send(mail)
dopo di che se cerco di cancellare i file inviati ad esempio con
File.Delete(Session("CompletePathFile1"))
Mi lancia l'eccezione IOException