Latest Register Log In

+ Advanced Search

Emailing Files

Emailing Files
By
04/18/13 (Edited 02/03/14)

Sometimes you may want to let people attach a file with their email message in the contact form, email member, email listing page or the like. This is possible since version 7.0.41. Here's how:

1. In the template where the email form is filled out, make sure enctype="multipart/form-data" is set on the form element. For the contact form, for example:

<form action="contactform.php?filled=1" method="post" enctype="multipart/form-data">

2. Add your file attachment fields in the form where you want them. Name them mailfiles1, mailfiles2, etc (only the actual filename attached is displayed in the email the recipient gets) and add as many as you like. For example:
Attach a file: <input type="file" name="mailfiles1">
Second file: <input type="file" name="mailfiles2">

Limitations: This won't work for bulk-email, like the admin panel send email page forms. It's incompatible with the send-all-emails-as-MIME option (in that it will ignore HTML and send as plain text).




Description How to mail a file attachment.
Rating
Views 295 views. Averaging 0 views per day.