Question : Email Attachment

My attached snippet works fine...

However...how would I include an attachment (~/attachments/myfile.xls)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Private Sub sendError()  
        Try  
            Dim HTML2 As String = "UserID: " & Session("UserName") & " has experienced an error.<br /> " & _  
                                    "Users Full Name: " & Session("fullName") & "<br />" & "Error Message: " & Session("ex")  
            Dim mess As New System.Net.Mail.MailMessage  
            Dim sc As New System.Net.Mail.SmtpClient  
            mess.To.Add(New System.Net.Mail.MailAddress("[email protected]"))  
            mess.CC.Add(New System.Net.Mail.MailAddress("[email protected]"))  
            mess.Subject = "Error Message"  
            mess.Body = HTML2  
            mess.From = New System.Net.Mail.MailAddress("[email protected]")  
            mess.IsBodyHtml = True  
            sc.Host = "mymaskedIPAddress"  
            sc.Send(mess)  
        Finally  
        End Try  
    End Sub

Answer : Email Attachment

Random Solutions  
 
programming4us programming4us