fix from Nigel Vicker to get replyTo working in FMail

This commit is contained in:
Ralf Becker 2007-08-20 15:33:01 +00:00
parent 1bae7bd196
commit ff5c696a71
2 changed files with 12 additions and 17 deletions

View File

@ -657,13 +657,13 @@
}
}
if (!empty($_formData['reply_to'])) {
$address_array = imap_rfc822_parse_adrlist($this->sessionData['reply_to'],'');
if(count($address_array)>0) {
$emailAddress = $address_array[0]->mailbox."@".$address_array[0]->host;
#$emailName = $bofelamimail->encodeHeader($address_array[0]->personal, 'q');
#$_mailObject->AddReplyTo($emailAddress, $emailName);
$_mailObject->AddReplyTo($emailAddress, $address_array[0]->personal);
foreach((array)$_formData['replyto'] as $address) {
$address_array = imap_rfc822_parse_adrlist($address,'');
foreach((array)$address_array as $addressObject) {
$emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$addressObject->host : '');
#$emailName = $bofelamimail->encodeHeader($addressObject->personal, 'q');
#$_mailObject->AddBCC($emailAddress, $emailName);
$_mailObject->AddReplyto($emailAddress, $addressObject->personal);
}
}
@ -756,13 +756,12 @@
$mail =& CreateObject('phpgwapi.phpmailer');
$messageIsDraft = false;
$this->sessionData['identity'] = $_formData['identity'];
$this->sessionData['to'] = $_formData['to'];
$this->sessionData['cc'] = $_formData['cc'];
$this->sessionData['bcc'] = $_formData['bcc'];
$this->sessionData['folder'] = $_formData['folder'];
$this->sessionData['reply_to'] = trim($_formData['reply_to']);
$this->sessionData['replyto'] = $_formData['replyto'];
$this->sessionData['subject'] = trim($_formData['subject']);
$this->sessionData['body'] = $_formData['body'];
$this->sessionData['priority'] = $_formData['priority'];
@ -770,7 +769,7 @@
$this->sessionData['disposition'] = $_formData['disposition'];
$this->sessionData['mimeType'] = $_formData['mimeType'];
$this->sessionData['to_infolog'] = $_formData['to_infolog'];
if(empty($this->sessionData['to']) && empty($this->sessionData['cc']) &&
empty($this->sessionData['bcc']) && empty($this->sessionData['folder'])) {
$messageIsDraft = true;

View File

@ -87,7 +87,6 @@
}
}
$formData['reply_to'] = $this->bocompose->stripSlashes($_POST['reply_to']);
$formData['subject'] = $this->bocompose->stripSlashes($_POST['subject']);
$formData['body'] = $this->bocompose->stripSlashes($_POST['body']);
$formData['priority'] = $this->bocompose->stripSlashes($_POST['priority']);
@ -198,16 +197,16 @@
$selectFrom = $GLOBALS['egw']->html->select('identity', $defaultIdentity, $identities, true, "style='width:100%;'");
$this->t->set_var('select_from', $selectFrom);
// from, to, cc
// from, to, cc, replyto
$this->t->set_var('img_clear_left', $GLOBALS['egw']->common->image('felamimail','clear_left'));
$this->t->set_var('img_fileopen', $GLOBALS['egw']->common->image('phpgwapi','fileopen'));
$this->t->set_var('img_mail_send', $GLOBALS['egw']->common->image('felamimail','mail_send'));
$this->t->set_var('img_attach_file', $GLOBALS['egw']->common->image('felamimail','attach'));
$this->t->set_var('ajax-loader', $GLOBALS['egw']->common->image('felamimail','ajax-loader'));
$this->t->set_var('img_fileexport', $GLOBALS['egw']->common->image('felamimail','fileexport'));
$destinationRows = 0;
foreach(array('to','cc','bcc') as $destination) {
foreach(array('to','cc','bcc','replyto') as $destination) {
foreach((array)$sessionData[$destination] as $key => $value) {
$selectDestination = $GLOBALS['egw']->html->select('destination[]', $destination, $this->destinations, false, "style='width: 100%;' onchange='fm_compose_changeInputType(this)'");
$this->t->set_var('select_destination', $selectDestination);
@ -230,9 +229,6 @@
$this->t->set_var('address', '');
$this->t->parse('destinationRows','destination_row',True);
$this->t->set_var("cc",@htmlentities($sessionData['cc'],ENT_QUOTES,$this->displayCharset));
$this->t->set_var("bcc",@htmlentities($sessionData['bcc'],ENT_QUOTES,$this->displayCharset));
$this->t->set_var("reply_to",@htmlentities($sessionData['reply_to'],ENT_QUOTES,$this->displayCharset));
$this->t->set_var("subject",@htmlentities($sessionData['subject'],ENT_QUOTES,$this->displayCharset));
$this->t->set_var('addressbookImage',$GLOBALS['egw']->common->image('phpgwapi/templates/phpgw_website','users'));
$this->t->set_var('infologImage',$GLOBALS['egw']->html->image('felamimail','to_infolog',lang('Save as infolog'),'width="17px" height="17px" valign="middle"' ));