Changeset 6673 for trunk/expressoMail1_2/inc/class.imap_functions.inc.php
- Timestamp:
- 06/28/12 15:18:46 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r6580 r6673 1139 1139 //$return['signature'] = $return_get_body['signature']; 1140 1140 } 1141 $pattern = '/^[ \t]*Disposition-Notification-To:[ ]*<?[[:alnum:]\._-]+@[[:alnum:]_-]+[\.[:alnum:]]+>?/sm'; 1141 1142 $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi'; 1142 1143 if (preg_match($pattern, $header_, $fields)) 1143 { 1144 if(preg_match('/[[:alnum:]\._\-]+@[[:alnum:]_\-\.]+/',$fields[0], $matches)){ 1145 $return['DispositionNotificationTo'] = "<".$matches[0].">"; 1146 } 1147 } 1144 $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0]))); 1148 1145 1149 1146 $return['Recent'] = $header->Recent; … … 2813 2810 $header = $this->get_header($msg_numb); 2814 2811 $header_ = imap_fetchheader($this->mbox, $msg_numb, FT_UID); 2815 $pattern = '/^[ \t]*Disposition-Notification-To:[ ]*<?[[:alnum:]\._-]+@[[:alnum:]_-]+[\.[:alnum:]]+>?/sm'; 2816 if (preg_match($pattern, $header_, $fields)) { 2817 if (preg_match('/[[:alnum:]\._\-]+@[[:alnum:]_\-\.]+/', $fields[0], $matches)) { 2818 $return['DispositionNotificationTo'] = "<" . $matches[0] . ">"; 2819 } 2820 } 2812 $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi'; 2813 if (preg_match($pattern, $header_, $fields)) 2814 $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0]))); 2821 2815 2822 2816 $message_id = $header->message_id; … … 3837 3831 } 3838 3832 3839 function send_notification($params){ 3840 include("../header.inc.php"); 3841 require_once("class.phpmailer.php"); 3842 $mail = new PHPMailer(); 3843 3844 $toaddress = $params['notificationto']; 3845 3846 $subject = lang("Read receipt: %1",$params['subject']); 3833 function send_notification($params) 3834 { 3835 $mailService = ServiceLocator::getService('mail'); 3847 3836 $body = lang("Your message: %1",$params['subject']) . '<br>'; 3848 3837 $body .= lang("Received in: %1",date("d/m/Y H:i",$params['date'])) . '<br>'; 3849 3838 $body .= lang("Has been read by: %1 < %2 > at %3", $_SESSION['phpgw_info']['expressomail']['user']['fullname'], $_SESSION['phpgw_info']['expressomail']['user']['email'], date("d/m/Y H:i")); 3850 $mail->SMTPDebug = false; 3851 $mail->IsSMTP(); 3852 $mail->Host = $_SESSION['phpgw_info']['expressomail']['email_server']['smtpServer']; 3853 $mail->Port = $_SESSION['phpgw_info']['expressomail']['email_server']['smtpPort']; 3854 $mail->From = $_SESSION['phpgw_info']['expressomail']['user']['email']; 3855 $mail->FromName = $_SESSION['phpgw_info']['expressomail']['user']['fullname']; 3856 $mail->AddAddress($toaddress); 3857 $mail->Subject = $this->htmlspecialchars_decode($subject); 3858 3859 $mail->IsHTML(true); 3860 $mail->Body = $body; 3861 3862 if(!$mail->Send()){ 3863 return $mail->ErrorInfo; 3864 } 3865 else 3866 return true; 3839 return $mailService->sendMail(base64_decode($params['notificationto']), 3840 $_SESSION['phpgw_info']['expressomail']['user']['email'], 3841 $this->htmlspecialchars_decode(lang("Read receipt: %1",$params['subject'])), 3842 $body); 3843 3867 3844 } 3868 3845
Note: See TracChangeset
for help on using the changeset viewer.