diff --git a/core/ajax/share.php b/core/ajax/share.php
index 9201b48cb954af5849b0b19334a376b37486a444..7ebd89497100ff0b9645c3ef8c1351ab001ed34a 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -110,7 +110,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
 
 			// send it out now
 			try {
-				OCP\Util::sendMail($to_address, $to_address, $subject, $text, $from_address, $user);
+				OCP\Util::sendMail($to_address, $to_address, $subject, $text, $from_address, $displayName);
 				OCP\JSON::success();
 			} catch (Exception $exception) {
 				OCP\JSON::error(array('data' => array('message' => OC_Util::sanitizeHTML($exception->getMessage()))));