Index: /trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 6580)
+++ /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 6673)
@@ -1139,11 +1139,8 @@
 	    //$return['signature']	= $return_get_body['signature'];
 		}
-		$pattern = '/^[ \t]*Disposition-Notification-To:[ ]*<?[[:alnum:]\._-]+@[[:alnum:]_-]+[\.[:alnum:]]+>?/sm';
+
+		$pattern = '/^[ \t]*Disposition-Notification-To:.*/mi';
 		if (preg_match($pattern, $header_, $fields))
-		{
-			if(preg_match('/[[:alnum:]\._\-]+@[[:alnum:]_\-\.]+/',$fields[0], $matches)){ 
-				$return['DispositionNotificationTo'] = "<".$matches[0].">"; 
-			} 
-		}
+			$return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0]))); 
 
 		$return['Recent']	= $header->Recent;
@@ -2813,10 +2810,7 @@
             $header = $this->get_header($msg_numb);
             $header_ = imap_fetchheader($this->mbox, $msg_numb, FT_UID);
-            $pattern = '/^[ \t]*Disposition-Notification-To:[ ]*<?[[:alnum:]\._-]+@[[:alnum:]_-]+[\.[:alnum:]]+>?/sm';
-            if (preg_match($pattern, $header_, $fields)) {
-                if (preg_match('/[[:alnum:]\._\-]+@[[:alnum:]_\-\.]+/', $fields[0], $matches)) {
-                    $return['DispositionNotificationTo'] = "<" . $matches[0] . ">";
-                }
-            }
+            $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi';
+			if (preg_match($pattern, $header_, $fields))
+				$return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0]))); 
 
             $message_id = $header->message_id;
@@ -3837,32 +3831,15 @@
 	}
 
-	function send_notification($params){
-		include("../header.inc.php");
-		require_once("class.phpmailer.php");
-		$mail = new PHPMailer();
-
-		$toaddress = $params['notificationto'];
-
-		$subject = lang("Read receipt: %1",$params['subject']);
+	function send_notification($params)
+	{
+		$mailService = ServiceLocator::getService('mail'); 
 		$body = lang("Your message: %1",$params['subject']) . '<br>';
 		$body .= lang("Received in: %1",date("d/m/Y H:i",$params['date'])) . '<br>';
 		$body .= lang("Has been read by: %1 &lt; %2 &gt; at %3", $_SESSION['phpgw_info']['expressomail']['user']['fullname'], $_SESSION['phpgw_info']['expressomail']['user']['email'], date("d/m/Y H:i"));
-		$mail->SMTPDebug = false;
-		$mail->IsSMTP();
-		$mail->Host = $_SESSION['phpgw_info']['expressomail']['email_server']['smtpServer'];
-		$mail->Port = $_SESSION['phpgw_info']['expressomail']['email_server']['smtpPort'];
-		$mail->From = $_SESSION['phpgw_info']['expressomail']['user']['email'];
-		$mail->FromName = $_SESSION['phpgw_info']['expressomail']['user']['fullname'];
-		$mail->AddAddress($toaddress);
-		$mail->Subject = $this->htmlspecialchars_decode($subject);
-
-		$mail->IsHTML(true);
-		$mail->Body = $body;
-
-		if(!$mail->Send()){
-   			return $mail->ErrorInfo;
-		}
-		else
-   			return true;
+		return $mailService->sendMail(base64_decode($params['notificationto']), 
+ 							   $_SESSION['phpgw_info']['expressomail']['user']['email'], 
+ 							   $this->htmlspecialchars_decode(lang("Read receipt: %1",$params['subject'])), 
+ 							   $body); 
+
 	}
 
Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 6628)
+++ /trunk/expressoMail1_2/js/main.js	(revision 6673)
@@ -526,5 +526,5 @@
 			 }
 			for (var i = 0; i < domains.length; i++)
-				if (msg_info.DispositionNotificationTo.match(domains[i]+">"))
+				if (Base64.decode(msg_info.DispositionNotificationTo).match("@"+domains[i]))
 				{
 					var confNotification = true;
@@ -532,5 +532,5 @@
 				}
 				if (confNotification == undefined)
-					var confNotification = confirm(get_lang("The sender:\n%1\nwaits your notification of reading. Do you want to confirm this?",msg_info.DispositionNotificationTo), "");
+					var confNotification = confirm(get_lang("The sender:\n%1\nwaits your notification of reading. Do you want to confirm this?",Base64.decode(msg_info.DispositionNotificationTo)), "");
 
 			if (confNotification)
