diff --git a/modules/Emails/views/MassSaveAjax.php b/modules/Emails/views/MassSaveAjax.php
index 39fa61962349837ef7ca97556c40b0149bd5fcce..db74b8a1f015b44c34be00cb2da08464d0eaa8a6 100644
--- a/modules/Emails/views/MassSaveAjax.php
+++ b/modules/Emails/views/MassSaveAjax.php
@@ -198,10 +198,6 @@ class Emails_MassSaveAjax_View extends Vtiger_Footer_View {
 					 */
 					$rawFileName = $existingAttachInfo['attachment'];
 					$file_name = $existingAttachInfo['storedname'];
-					// Checking becuase the pdf sent from sales order will not have the storedname
-					if(!$file_name) {
-						$file_name = $existingAttachInfo['attachment'];
-					}
 					$path = $existingAttachInfo['path'];
 					$fileId = $existingAttachInfo['fileid'];
 
diff --git a/modules/Inventory/views/SendEmail.php b/modules/Inventory/views/SendEmail.php
index d5eaae3f339daad5707043bbba8ed99fd41a1000..d5cfbd4a838529785cdc4f4068edfcf8b9728d2a 100644
--- a/modules/Inventory/views/SendEmail.php
+++ b/modules/Inventory/views/SendEmail.php
@@ -32,8 +32,10 @@ class Inventory_SendEmail_View extends Vtiger_ComposeEmail_View {
             'attachment' =>$fileName,
             'path' => implode('/',$fileComponents),
             'size' => filesize($pdfFileName),
-				'type' => 'pdf',
-				'nondeletable' => true
+			'type' => 'pdf',
+			'nondeletable' => true,
+			// The stored name is needed to send the file with the email.
+			'storedname' => $fileName
 		));
 
 		$this->populateTo($request);