mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
now you are able to send mails; not fully functional yet
This commit is contained in:
parent
9b9a1df8a3
commit
82dcae783a
@ -3038,7 +3038,7 @@ class mail_bo
|
||||
if ($_charset===false) $_charset = self::$displayCharset;
|
||||
$_stringORG = $_string;
|
||||
$_string = @htmlspecialchars($_string,ENT_QUOTES,$_charset, false);
|
||||
if (empty($_string) && !empty($_stringORG)) $_string = @htmlspecialchars(translation::convert($_stringORG,self::detect_encoding($_stringORG),$_charset),ENT_QUOTES | ENT_IGNORE,$_charset, false);
|
||||
if (empty($_string) && !empty($_stringORG)) $_string = @htmlspecialchars(translation::convert($_stringORG,translation::detect_encoding($_stringORG),$_charset),ENT_QUOTES | ENT_IGNORE,$_charset, false);
|
||||
return $_string;
|
||||
}
|
||||
|
||||
@ -4933,6 +4933,11 @@ class mail_bo
|
||||
return $bytes . ' ' . $type ;
|
||||
}
|
||||
|
||||
static function detect_qp(&$sting) {
|
||||
$needle = '/(=[0-9][A-F])|(=[A-F][0-9])|(=[A-F][A-F])|(=[0-9][0-9])/';
|
||||
return preg_match("$needle",$string);
|
||||
}
|
||||
|
||||
/**
|
||||
* checkFileBasics
|
||||
* check if formdata meets basic restrictions (in tmp dir, or vfs, mimetype, etc.)
|
||||
|
@ -358,16 +358,28 @@ $CAtFStart = array2string($_content);
|
||||
$sendOK = true;
|
||||
try
|
||||
{
|
||||
$_content['body'] = ($_content['body'] ? $_content['body'] : $_content['mail_'.($_content['mimeType'] == 'html'?'html':'plain').'text']);
|
||||
$success = $this->send($_content);
|
||||
if ($success==false)
|
||||
{
|
||||
$sendOK=false;
|
||||
$message = $this->errorInfo;
|
||||
}
|
||||
}
|
||||
catch (egw_exception_wrong_userinput $e)
|
||||
{
|
||||
$sendOK = false;
|
||||
$message = $e->getMessage();
|
||||
}
|
||||
if ($sendOK)
|
||||
{
|
||||
egw_framework::refresh_opener(lang('Message send successfully.'),'mail');
|
||||
egw_framework::window_close();
|
||||
}
|
||||
if ($sendOK == false)
|
||||
{
|
||||
egw_framework::refresh_opener(lang('Message send failed: %1',$message),'mail');
|
||||
}
|
||||
}
|
||||
if ($_content['button']['saveAsDraft'])
|
||||
{
|
||||
@ -1067,7 +1079,7 @@ $CAtFStart = array2string($_content);
|
||||
if ($addressObject->host == '.SYNTAX-ERROR.') continue;
|
||||
$address = imap_rfc822_write_address($addressObject->mailbox,$addressObject->host,$addressObject->personal);
|
||||
//$address = mail_bo::htmlentities($address, $this->displayCharset);
|
||||
$content[strtoupper($destination)][]=$address;
|
||||
$content[strtolower($destination)][]=$address;
|
||||
$destinationRows++;
|
||||
}
|
||||
}
|
||||
@ -1077,13 +1089,13 @@ $CAtFStart = array2string($_content);
|
||||
{
|
||||
$content = array_merge($content,$_content);
|
||||
|
||||
if (!empty($content['FOLDER'])) $sel_options['FOLDER']=$this->ajax_searchFolder(0,true);
|
||||
$content['SENDER'] = (empty($content['SENDER'])?($selectedSender?(array)$selectedSender:''):$content['SENDER']);
|
||||
if (!empty($content['folder'])) $sel_options['folder']=$this->ajax_searchFolder(0,true);
|
||||
$content['sender'] = (empty($content['sender'])?($selectedSender?(array)$selectedSender:''):$content['sender']);
|
||||
}
|
||||
else
|
||||
{
|
||||
//error_log(__METHOD__.__LINE__.array2string(array($sel_options['SENDER'],$selectedSender)));
|
||||
$content['SENDER'] = ($selectedSender?(array)$selectedSender:'');
|
||||
$content['sender'] = ($selectedSender?(array)$selectedSender:'');
|
||||
//error_log(__METHOD__.__LINE__.$content['body']);
|
||||
}
|
||||
$content['is_html'] = ($content['mimeType'] == 'html'?true:'');
|
||||
|
@ -6,7 +6,7 @@
|
||||
<vbox class="mailCompose mailComposeHeaderSection" width="100%">
|
||||
<hbox class="mailComposeHeaders" width="99%">
|
||||
<description value="Identity"/>
|
||||
<taglist-email id="SENDER" width="88%" allowFreeEntries="false" maxSelection="1" autocomplete_url="mail.mail_compose.ajax_searchIdentities" onclick="app.mail.address_click"/>
|
||||
<taglist-email id="sender" width="88%" allowFreeEntries="false" maxSelection="1" autocomplete_url="mail.mail_compose.ajax_searchIdentities" onclick="app.mail.address_click"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button label="Send" id="button[send]"/> <buttononly value="saveAsDraft" id="button[saveAsDraft]" image="fileexport" onclick="app.mail.saveAsDraft"/>
|
||||
@ -15,23 +15,23 @@
|
||||
</hbox>
|
||||
<hbox class="mailComposeHeaders" width="99%">
|
||||
<description value="To"/>
|
||||
<taglist-email id="TO" width="88%" onclick="app.mail.address_click"/>
|
||||
<taglist-email id="to" width="88%" onclick="app.mail.address_click"/>
|
||||
</hbox>
|
||||
<hbox class="mailComposeHeaders" width="99%">
|
||||
<description value="Cc"/>
|
||||
<taglist-email id="CC" width="88%" onclick="app.mail.address_click"/>
|
||||
<taglist-email id="cc" width="88%" onclick="app.mail.address_click"/>
|
||||
</hbox>
|
||||
<hbox class="mailComposeHeaders" width="99%">
|
||||
<description value="Bcc"/>
|
||||
<taglist-email id="BCC" width="88%" onclick="app.mail.address_click"/>
|
||||
<taglist-email id="bcc" width="88%" onclick="app.mail.address_click"/>
|
||||
</hbox>
|
||||
<hbox class="mailComposeHeaders" width="99%">
|
||||
<description value="Reply To"/>
|
||||
<taglist-email id="REPLYTO" width="88%" maxSelection="1" onclick="app.mail.address_click"/>
|
||||
<taglist-email id="replyto" width="88%" maxSelection="1" onclick="app.mail.address_click"/>
|
||||
</hbox>
|
||||
<hbox class="mailComposeHeaders" width="99%">
|
||||
<description value="Store to Folder"/>
|
||||
<taglist id="FOLDER" width="88%" autocomplete_url='mail.mail_compose.ajax_searchFolder' autocomplete_params='' allowFreeEntries="false" onclick="app.mail.address_click"/>
|
||||
<taglist id="folder" width="88%" autocomplete_url='mail.mail_compose.ajax_searchFolder' autocomplete_params='' allowFreeEntries="false" onclick="app.mail.address_click"/>
|
||||
</hbox>
|
||||
<hbox class="mailComposeHeaders" width="99%">
|
||||
<description value="Subject"/>
|
||||
|
Loading…
Reference in New Issue
Block a user