diff --git a/contactform/controllers/ContactFormController.php b/contactform/controllers/ContactFormController.php
index <HASH>..<HASH> 100644
--- a/contactform/controllers/ContactFormController.php
+++ b/contactform/controllers/ContactFormController.php
@@ -30,7 +30,11 @@ class ContactFormController extends BaseController
 		$message->fromEmail  = craft()->request->getPost('fromEmail');
 		$message->fromName	 = craft()->request->getPost('fromName');
 		$message->subject    = craft()->request->getPost('subject');
-		$message->attachment = \CUploadedFile::getInstanceByName('attachment');
+
+		if ($settings->allowAttachments)
+		{
+			$message->attachment = \CUploadedFile::getInstanceByName('attachment');
+		}
 
 		// Set the message body
 		$postedMessage = craft()->request->getPost('message');
Fix a bug where the "allowAttachments" setting wasn't being enforced.