Nicholasp27
New member
- Joined
- Aug 22, 2004
- Messages
- 2
- Programming Experience
- 3-5
Ok, so i'm doing vb.net web page and i am sending an email via smtp. All works fine. Then i added an html control for file dialog and it works fine if i choose say "c:\test.doc"
however, if i choose say "c:\documents and settings\desktop\Nicholasp27\test.doc" then it gives an "invalid mail attachment" error!
basically, if there is a space in the file path, it won't work...if no spaces, works fine
please help!!
something like this:
Dim mailAttachment As Mail.MailAttachment
Try
mailAttachment = New Mail.MailAttachment("c:\Test Document.txt")
email.Attachments.Add(mailAttachment)
System.Web.Mail.SmtpMail.SmtpServer = "smtp.servername.com"
System.Web.Mail.SmtpMail.Send(email)
however, if i choose say "c:\documents and settings\desktop\Nicholasp27\test.doc" then it gives an "invalid mail attachment" error!
basically, if there is a space in the file path, it won't work...if no spaces, works fine
please help!!
something like this:
Dim mailAttachment As Mail.MailAttachment
Try
mailAttachment = New Mail.MailAttachment("c:\Test Document.txt")
email.Attachments.Add(mailAttachment)
System.Web.Mail.SmtpMail.SmtpServer = "smtp.servername.com"
System.Web.Mail.SmtpMail.Send(email)
Last edited: