PDA

View Full Version : HT add upload image email feature to existing form?


anessa05
12-11-2005, 05:52 PM
Hello,

I'm a newby with the VBScripting and need help incorporating an email form that sends attachments with an existing form that sends html emails and uses captcha verification. Each forms works fine. I would just like to insert the image attachment functionality to the existing form. Can someone instruct me on how to do that please? Any assistance would be much appreciated. Attached is the code for both forms. I attempted to paste the code here, but it would it was cut off in the post.

Anessa

BarrMan
12-11-2005, 06:09 PM
This is the code you should use for email send in asp.

<%
Set Email = Server.CreateObject("CDO.Message")
Email.From = "name@domain.com"
Email.To = "name@domain.com"
Email.Subject = "Subject"
Email.HTMLBody = "Body"
Email.Attachment = "c:/folder/file.exe"
Email.Send
Set Email = Nothing
%>

You can post full codes in here but user to wrap it.

anessa05
12-11-2005, 06:43 PM
Thank you for your response. Unfortunately,
Email.Attachment = "c:/folder/file.exe" won't work because the attachment is sent by the person submitting the form, so I cannot specify it.

The form has...

Attachment: <input type="file" name="File 1">

BarrMan
12-11-2005, 07:58 PM
So save the file on the server and then
Email.attachment = "Attachments/attachmentfile.exe"

anessa05
12-14-2005, 05:54 PM
Thanks for the suggestion. As I am a newby, could you elaborate a bit more on how I save the file on the server and then attach it to the email please? Perhaps an example?

TheShaner
12-14-2005, 06:05 PM
Ok, I've coded this for my company, but first, you need to get a fairly strong grasp with ASP. This is a pretty complicated process. Uploading with ASP isn't that simple, as I had to find a script online to help me. You need to have the correct permissions set up on your server to upload to your server and then delete from your server.

What I did is upload the file to the server, attach as an email and send, and then delete from the server.

Read this:
http://www.asp101.com/articles/jacob/scriptupload.asp

This should get you on your way.

-Shane

BarrMan
12-14-2005, 06:09 PM
You just upload the file to your server...

TheShaner
12-14-2005, 06:24 PM
Barrman, the attachment is being submitted by a form, which means you need ASP code to process the file from the form and upload it.

-Shane