RSS for ' . $email . ' https://' . DOMAIN . '/#' . $email . ' RSS Feed for email address ' . $email . ' ' . date(DateTime::RFC2822, time()) . ' RSS for ' . $email . ' https://raw.githubusercontent.com/HaschekSolutions/opentrashmail/master/web/imgs/logo_300.png https://github.com/HaschekSolutions/opentrashmail '; $emaildata = getEmailsOfEmail($email); foreach ($emaildata as $id => $d) { $data = getEmail($email, $id); //var_dump($data); $time = substr($id, 0, -3); $date = date("Y-m-d H:i", $time); $att_text = array(); $encl = array(); if (is_array($data['parsed']['attachments'])) foreach ($data['parsed']['attachments'] as $filename) { $filepath = ROOT . DS . '..' . DS . 'data' . DS . $email . DS . 'attachments' . DS . $filename; $parts = explode('-', $filename); $fid = $parts[0]; $fn = $parts[1]; $url = 'https://' . DOMAIN . '/api.php?a=attachment&email=' . $email . '&id=' . $fid . '&filename=' . $fn; //$encl[] = ''; $att_text[] = "$fn"; } $rss .= ' <![CDATA[' . $data['parsed']['subject'] . ']]> ' . date(DateTime::RFC2822, $time) . ' https://' . DOMAIN . '/#' . $email . ' https://' . DOMAIN . '/api.php?a=load&email=' . $email . '&id=' . $id . '&raw=true Email to: ' . (is_array($data['rcpts']) ? htmlentities(implode(',', $data['rcpts'])) : htmlentities($email)) . '
' . ((count($att_text) > 0) ? 'Attachments:
' . array2ul($att_text) . '
' : '') . ' View raw email

---------

' . ($data['parsed']['htmlbody'] ? $data['parsed']['htmlbody'] : nl2br(htmlentities($data['parsed']['body']))) . ' ]]>
' ./*((count($encl)>0)?implode('
',$encl):'').*/ '
'; //if (++$i > 5) break; } $rss .= '
'; echo $rss; function array2ul($array) { $out = ""; return $out; }