Exemple #1
0
$var['emailsubject'] = $_REQUEST['emailsubject'];
$var['emailpriority'] = $_REQUEST['emailpriority'];
$var['contype'] = $_REQUEST['contype'];
$var['unique'] = $_REQUEST['unique'];
$var['UIDL'] = $_REQUEST['UIDL'];
$var['type'] = $_REQUEST['type'];
$var['emailfrom'] = $_REQUEST['emailfrom'];
$var['Charset'] = $_REQUEST['Charset'];
$var['DraftID'] = $_REQUEST['DraftID'];
$var['ReadReceipt'] = $_REQUEST['ReadReceipt'];
$var['Draft'] = $_REQUEST['Draft'];
$var['VideoStream'] = $_REQUEST['VideoStream'];
$var['id'] = $_REQUEST['id'];
// format the addresses
foreach (array('emailto', 'emailcc', 'emailbcc') as $k) {
    $var[$k] = ReadMsg::cleanEmailAddress($var[$k]);
}
// Switch to our default character-set if not defined
if (!$var['Charset']) {
    $var['Charset'] = $atmail->EmailEncoding;
}
// Make a new UIDL if one does not exist
if (!$var['UIDL']) {
    $var['UIDL'] = time() . getmypid() . rand(0, 9000) . $atmail->genkey();
    $var['UIDL'] = preg_replace('/\\..*/', '', $var['UIDL']);
}
// Find which EmailBox to save into
if ($_REQUEST['Draft']) {
    $var['msgbox'] = 'Drafts';
} else {
    $var['msgbox'] = 'Sent';