Jump to content

How do I get an attachment in an html form (Dreamweaver) to email to me?


byoung42

Recommended Posts

I am building a website that allows a client to email me documents (DocX, PDF, TXT,ZIP, etc) along with a simple HTML based form.

 

I used DreamWeaver to create the form and the upload area.  I figured out how to script the PHP code to send the text fields to my email address (and validate them), but I can't figure out how to get the attachments to send.

 

I am BRAND NEW to PHP and just trying to figure all thing out.  Any help would be appreciated. 

 

I have attached two .txt files to this post.  One is the HTML code for the forum and one is the actual PHP code I am using to send the form to my email.

 

Thanks for your help!

 

[attachment deleted by admin]

Link to comment
Share on other sites

I think you have to add, in the first line of the form (where you have the action and method) this "enctype="multipart/form-data"

and then a line where you create the field to upload the file, "<tr>

<td><input type = "file" name = "teste_ficheiro" size = "100"><td/>

<tr/> "

 

Hope it helps!

Link to comment
Share on other sites

The encype="multipart/form-data is already in the HTML form.  Does it need to be in the PHP processing code?  If so, where?

 

Also, the "size" command in html is changing the actual file upload field, not the file size capacity.... once again, if I am understanding correctly.

 

Do I need to do anything to the PHP process to get the attached files to send?  Or is there something in the HTML I still need to do?

 

Thanks for your help!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.