Adding attachment to CDO.message object

B

Bonnie

I am using the CDO.message object to create an email
message in the script on my ASP page and I would like the
ability to let the user add an attachment to the email. I
know I can do it like this:

objMsg.AddAttachment("c:\temp\aaradvark.jpg")

And I can get the user to put the file's path on a form
and plug that into the code. But what I really want to do
is let the user actually browse to get the attachment, (as
in Outlook). Is this possible using vbscript over the web?

Thanks for your help!
Bonnie
 
K

Kevin Spencer

Hi Bonnie,

It is possible. However, assuming that you want the user to attach a file
from THEIR machine, you would have to create a form which has an "input
type=file" form field in it, and write the code that allows them to do the
upload. FrontPage 2003 has a file upload component that you can use, or you
can write your own ASP application to do it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
B

Bonnie

Hi Kevin,

Thanks for the response. Do you have a link where I can go
to find out more about how to do that?

Thanks again!
Bonnie
 
K

Kevin Spencer

Find out more about how to do what?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
B

bonnie

How can I use the file upload component to get the file to
attach to the email I am creating in my script? Or where
can I find examples of code that I can look at?

Thanks,
Bonnie
 
K

Kevin Spencer

What version of FrontPage are you using?

As for examples of code, I don't know of any. You're talking about a custom
application here. Perhaps there is something out there on the Internet
somewhere, but I wouldn't know.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
G

Guest

Frontpage 2002

Thanks,
Bonnie
-----Original Message-----
What version of FrontPage are you using?

As for examples of code, I don't know of any. You're talking about a custom
application here. Perhaps there is something out there on the Internet
somewhere, but I wouldn't know.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.




.
 
K

Kevin Spencer

Hi Bonne,

As I mentioned previously, the FrontPage upload component is a feature of
version 2003. So, in your case, you would have to use a third-party COM
object to do the file upload, such as SAFileUp, from Software Artisans
(http://www.softartisans.com). Their documentation should help you with
writing the code to do the file upload.

The basics of it are these: The user selects a file from their system and
submits the form, which contains the file uploaded. On the server, you save
the file to a folder. Then you can add the file as an attachment using CDO.

Good luck!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
G

Guest

Ok, I understand what you mean, I have seen some of these
products such as ASPUpload and ASPMail. However, FP 2002
does have the file upload control available. I have added
it to a form trying to get it to work. Using FP Help, I
have created a folder on the web for the uploaded files to
go, and configured it to allow anonymous uploads. I have
also configured the form properties as the FP help file
suggests. Still not working though. It acts like it is
working but the file never gets to the folder.

Thanks,
Bonnie
 
K

Kevin Spencer

What is "it" ("I have added it to a form...")?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
G

Guest

"However, FP 2002 does have the file upload control
available. I have added it to a form trying to get it to
work."

The "IT" I am referring to in the second sentence is the
FILE UPLOAD CONTROL.

Sorry for not spelling it out more clearly. Darn English
language, can be tricky, can't it? :)
 

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

Top