G
Guest
I have a web service. It creates a email and attached a file sitting one the
network drive \\servername\filename. I tried UNC format and also try to
mapping drive (eg. g:\text.txt or g:\\text.txt). I also check the permission
of the file and file sharing (grant to everyone), I still got the following
err:
Server was unable to process request. --> Invalid mail attachment
'g:\\g:\\text.txt)'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Here is the code:
Dim mailMessage As New System.Web.Mail.MailMessage
Dim emailAttachment As New System.Web.Mail.MailAttachment
mailMessage.To = strSubmissionEmailAddress
mailMessage.Cc = "(e-mail address removed)"
mailMessage.From = "(e-mail address removed)"
mailMessage.Subject = "test"
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text
mailMessage.Body = pStrMessageBody
mailMessage.Attachments.Add(emailAttachment)
SmtpMail.SmtpServer = strSubmissionSmtpServer
SmtpMail.Send(mailMessage)
Please help! Thank you!
network drive \\servername\filename. I tried UNC format and also try to
mapping drive (eg. g:\text.txt or g:\\text.txt). I also check the permission
of the file and file sharing (grant to everyone), I still got the following
err:
Server was unable to process request. --> Invalid mail attachment
'g:\\g:\\text.txt)'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Here is the code:
Dim mailMessage As New System.Web.Mail.MailMessage
Dim emailAttachment As New System.Web.Mail.MailAttachment
mailMessage.To = strSubmissionEmailAddress
mailMessage.Cc = "(e-mail address removed)"
mailMessage.From = "(e-mail address removed)"
mailMessage.Subject = "test"
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text
mailMessage.Body = pStrMessageBody
mailMessage.Attachments.Add(emailAttachment)
SmtpMail.SmtpServer = strSubmissionSmtpServer
SmtpMail.Send(mailMessage)
Please help! Thank you!