styler Posted October 2, 2008 Share Posted October 2, 2008 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 Link to comment https://forums.phpfreaks.com/topic/126723-can-you-send-a-file-with-the-mail-function/ Share on other sites More sharing options...
JonnoTheDev Posted October 2, 2008 Share Posted October 2, 2008 Not designed for attachments. Use PEAR::Mail_Mime http://pear.php.net/package/Mail_Mime Link to comment https://forums.phpfreaks.com/topic/126723-can-you-send-a-file-with-the-mail-function/#findComment-655473 Share on other sites More sharing options...
PFMaBiSmAd Posted October 2, 2008 Share Posted October 2, 2008 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/ Link to comment https://forums.phpfreaks.com/topic/126723-can-you-send-a-file-with-the-mail-function/#findComment-655538 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.