Jump to content

can you send a file with the mail function?


styler

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/

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.