SMTP Attachment issue

I am creating numerous forms that SMTP the results. There is an option to attach attachments that is giving me some issues. On my PC everything works perfectly, however, when another user access the application off of my PC they are unable to send attachments. I believe this is because I am attaching the attachment with just the string, making it so my PC cannot locate the file when the user tries to use the application from their PC.

Here is my current code snippet:
If (File2.Value <> "") Then
Mail.Attachments.Add(New MailAttachment(File2.Value))
End If

How can I modify this to load their attachment to my PC to send the email using VB? (And even delete it afterwards) Thanks in advance for your help.Problem solved with this code:
If (File3.Value <> "") Then
Dim strFileName3 As String = File3.PostedFile.FileName
Dim c3 As String = System.IO.Path.GetFileName(strFileName3)
Try
File3.PostedFile.SaveAs(strPath & c3)
Catch Exp As Exception
Response.Write("Error" & Exp.Message)
End Try
Mail.Attachments.Add(New MailAttachment(strPath & c3))

attach3 = (strPath & c3)
End If
 
Back
Top