Jump to content

Recommended Posts

Hi,

 

I want to gather data from an html form to be sent to my email and have been using the mail function fine for this, although for the first time i have added a section allowing the user to upload a file. When this sends i just get the text of the file name.

 

Is it possible to send a file with the mail function?

 

thanks for your help

Sending a file in an email requires forming a multi-part mime message. You can do this yourself and send it using the mail() function, but this requires defining and forming mime boundaries and base64 encoding the data... Here is a tutorial I found by searching - http://www.apptools.com/phptools/forms/forms5.php

 

Several classes exist that do the work for you. One of these is the phpmailer class - http://phpmailer.codeworxtech.com/

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.