Avatar of clearchannel

asked on 

Sending attachments via email - cant find file

I am trying to send an email to a user with 5 attachments but I keep reporting errors that the file can not be found. Now I am guessing this is because the webserver is looking for the file on the local server disk and not the local user's machine.

I have included my current code below. How do I rectify this issue?

If Not FileUpload1.PostedFile Is Nothing And FileUpload1.PostedFile.ContentLength > 0 Then
                    File1 = System.IO.Path.GetFullPath(FileUpload1.PostedFile.FileName)
                    mailMessage.Attachments.Add(New Attachment(File1))
                End If

Open in new window

ASP.NETVisual Basic.NET

Avatar of undefined
Last Comment

8/22/2022 - Mon