$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';
function extract_eml($path) { global $email, $atmail, $auth; $email2 = new ReadMsg(array('Username' => $atmail->username, 'Pop3host' => $atmail->pop3host, 'Password' => $auth->password, 'Type' => $atmail->MailType, 'Mode' => $atmail->Mode, 'SessionID' => $auth->SessionID, 'Language' => $atmail->Language, 'DateFormat' => $atmail->DateFormat, 'TimeFormat' => $atmail->TimeFormat, 'LoginType' => $type, 'head' => 1, 'rawemail' => $var['rawemail'])); $email2->reademail('', '', '', '', $path); if ($email2->html) { $type = 'html'; } elseif ($email2->txt) { $type = 'txt'; } elseif ($email2->multiparttxt) { $type = 'multiparttxt'; } else { $type = 'html'; } $myvars = array('subject' => $email2->subject, 'from' => htmlentities($email2->from), 'to' => htmlentities($email2->to), 'date' => $email2->date, 'body' => $email2->{$type}); $fwdmsg = $atmail->parse("html/{$atmail->Language}/fwdmsg.html", $myvars); if ($email->html) { $email->html .= $fwdmsg; } elseif ($email->txt) { $email->txt .= $fwdmsg; } else { $email->html .= $fwdmsg; } unset($fwdmsg); parse_attachments($email2); foreach ($email2->attachedemails as $path2) { extract_eml($path2); } }