Attachments

S

STEPHEN ANDRADE

I am currently designing a webform for sending email. I want to send an
attachment with the email. I am using the html Input File to pick the
location of the file I want to attach.

I find that there is no problem sending an attachment when there are no
spaces in the directory (e.g. c:\images\new.jpg) but if the path specified
has spaces (c:\documents and settings\my documents\new.jpg) then I am
getting http exception I have tried using different character instead of the
spaces

If uploadedfile.Value <> "" Then

Dim substring As String

substring = uploadedfile.Value.ToString 'uplodedfile = htmlinputfile

Dim Attach As MailAttachment = New MailAttachment(substring)

Message.Attachments.Add(Attach)

Response.Write(uploadedfile.Value)

End If

If you have any suggestions I wouuld love to hear them

Thanks in advance
Stephen
 
B

bruce barker

the htmlinputfile is the location on the client machine, not the server.
you should write the uploaded file to disk, then use that file as an
attachment.

-- bruce (sqkwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top