diff --git a/components/file.inc b/components/file.inc
index e294416..c2436bf 100644
--- a/components/file.inc
+++ b/components/file.inc
@@ -656,3 +656,12 @@ function webform_get_file($fid) {
 
   return $files[$fid];
 }
+
+/**
+ * Implements _webform_attachments_component().
+ */
+function _webform_attachments_file($component, $value) {
+  $file = (array)webform_get_file($value[0]);
+  $files = array($file);
+  return $files;
+}
diff --git a/includes/webform.submissions.inc b/includes/webform.submissions.inc
index 5811196..88eae3f 100644
--- a/includes/webform.submissions.inc
+++ b/includes/webform.submissions.inc
@@ -259,9 +259,11 @@ function webform_submission_send_mail($node, $submission, $emails = NULL) {
           webform_component_include('file');
           foreach ($node->webform['components'] as $component) {
             if (webform_component_feature($component['type'], 'attachment') && !empty($submission->data[$component['cid']]['value'][0])) {
-              $file = webform_get_file($submission->data[$component['cid']]['value'][0]);
-              if ($file) {
-                $attachments[] = $file;
+              if (webform_component_implements($component['type'], 'attachments')) {
+                $files = webform_component_invoke($component['type'], 'attachments', $component, $submission->data[$component['cid']]['value']);
+                if ($files) {
+                  $attachments = array_merge($attachments, $files);
+                }
               }
             }
           }
diff --git a/webform_hooks.php b/webform_hooks.php
index b25ca39..54e7076 100644
--- a/webform_hooks.php
+++ b/webform_hooks.php
@@ -724,5 +724,38 @@ function _webform_csv_data_component($component, $export_options, $value) {
 }
 
 /**
+ * Return an array of files associated with the component.
+ *
+ * The output of this function will be used to attach files to e-mail messages.
+ *
+ * @param $component
+ *   A Webform component array.
+ * @param $value
+ *   An array of information containing the submission result, directly
+ *   correlating to the webform_submitted_data database schema.
+ * @return
+ *   An array of files, each file is an array with following keys:
+ *     - filepath: The relative path to the file.
+ *     - filename: The name of the file including the extension.
+ *     - filemime: The mimetype of the file.
+ *   This will result in an array looking something like this:
+ *   Array
+ *   (
+ *     [0] => Array
+ *       (
+ *         [filepath] => '/sites/default/files/attachment.txt'
+ *         [filename] => 'attachment.txt'
+ *         [filemime] => 'text/plain'
+ *       )
+ *   )
+ */
+function _webform_attachments_component($component, $value) {
+  $files = array();
+  $files[] = db_fetch_object(db_query("SELECT * FROM {files} WHERE fid = %d", $value));
+  return $files;
+}
+
+
+/**
  * @}
  */
