diff --git a/core/ajax/share.php b/core/ajax/share.php
index e667d9b5faae6a282845ff361976d4aabd31daca..2b41bd8a5da17fb8693f50c658d3e6dd77db546b 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -205,6 +205,34 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
 				OC_JSON::success(array('data' => array('reshare' => $reshare, 'shares' => $shares)));
 			}
 			break;
+		case 'getShareWithEmail':
+			$result = array();
+			if (isset($_GET['search'])) {
+				$cm = OC::$server->getContactsManager();
+				if (!is_null($cm) && $cm->isEnabled()) {
+					$contacts = $cm->search($_GET['search'], array('FN', 'EMAIL'));
+					foreach ($contacts as $contact) {
+						if (!isset($contact['EMAIL'])) {
+							continue;
+						}
+
+						$emails = $contact['EMAIL'];
+						if (!is_array($emails)) {
+							$emails = array($emails);
+						}
+
+						foreach($emails as $email) {
+							$result[] = array(
+								'id' => $contact['id'],
+								'email' => $email,
+								'displayname' => $contact['FN'],
+							);
+						}
+					}
+				}
+			}
+			OC_JSON::success(array('data' => $result));
+			break;
 		case 'getShareWith':
 			if (isset($_GET['search'])) {
 				$sharePolicy = OC_Appconfig::getValue('core', 'shareapi_share_policy', 'global');
diff --git a/core/js/share.js b/core/js/share.js
index ef71cc7999a7d589bb78f753df5d0a2b29b580ac..5cabc6145634e94b32c6ea6ae60135ebcc71aa03 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -331,6 +331,26 @@ OC.Share={
 					.append( insert )
 					.appendTo( ul );
 			};
+			$('#email').autocomplete({
+				minLength: 1,
+				source: function (search, response) {
+					$.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getShareWithEmail', search: search.term }, function(result) {
+						if (result.status == 'success' && result.data.length > 0) {
+							response(result.data);
+						}
+					});
+					},
+				select: function( event, item ) {
+					$('#email').val(item.item.email);
+					return false;
+				}
+			})
+			.data("ui-autocomplete")._renderItem = function( ul, item ) {
+				return $( "<li>" )
+					.append( "<a>" + item.displayname + "<br>" + item.email + "</a>" )
+					.appendTo( ul );
+			};
+
 		} else {
 			html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Resharing is not allowed')+'" style="width:90%;" disabled="disabled"/>';
 			html += '</div>';