Fixed variable name causing problem
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index b898bae..6be2943 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1156,7 +1156,7 @@
 			
 			if( ! $basename)
 			{
-				$basename = basename($filename);
+				$basename = basename($filepath);
 			}
 				
 			$ctype = $this->_attach_type[$i];