A
Alex
Hi,
I need some help with sending email from ASP.NET application. The problem is
that the file that I need to attach to the email is located on different
server. My code looks like this:
Dim mail As New MailMessage
mail.To = "(e-mail address removed)"
mail.From = "(e-mail address removed)"
mail.Subject = "test"
mail.Body = "This is a sample email"
Try
Dim attachment As New
MailAttachment("\\SERVER1\MyShares\Sample.csv") 'create the attachment
mail.Attachments.Add(attachment)
SmtpMail.Send(mail)
Catch ex As Exception
Response.Write("Exception occurred:" & ex.Message)
End Try
When I run the above code I get the following error:
Invalid mail attachment '\\SERVER1\MyShares\Sample.csv'.
I appreciate any help.
Alex.
I need some help with sending email from ASP.NET application. The problem is
that the file that I need to attach to the email is located on different
server. My code looks like this:
Dim mail As New MailMessage
mail.To = "(e-mail address removed)"
mail.From = "(e-mail address removed)"
mail.Subject = "test"
mail.Body = "This is a sample email"
Try
Dim attachment As New
MailAttachment("\\SERVER1\MyShares\Sample.csv") 'create the attachment
mail.Attachments.Add(attachment)
SmtpMail.Send(mail)
Catch ex As Exception
Response.Write("Exception occurred:" & ex.Message)
End Try
When I run the above code I get the following error:
Invalid mail attachment '\\SERVER1\MyShares\Sample.csv'.
I appreciate any help.
Alex.