topical media & game development
professional-ajax-09-AjaxMail-inc-pop3lib-pop3message.class.php / php
<?php
class Pop3Message {
var to;
var subject;
var cc;
var unixTimeStamp;
var isMultipart;
var hasAttachments;
var attachments;
//Content
var plainText;
function Pop3Message(this->header = new Pop3Header(this->hasAttachments = 0;
this->header->getHeader('from');
this->header->getHeader('subject');
this->header->getHeader('to');
this->header->getHeader('date');
this->header->getHeader('bcc');
this->header->getHeader('cc');
this->date);
}
function getTextMessage() {
if (this->plainText;
} else if (string = str_replace("</p>","<br/><br/>", string, '<br><br/>');
}
}
function getHtmlMessage() {
return (this->htmlText):header,header = (header:content_transfer_encoding = (array_key_exists("content-transfer-encoding", header["content-transfer-encoding"])):"8bit";
/*
if (content_transfer_encoding = "8bit";
}*/
this->_textDecode(message);
header["content-type"], 2);
for(i < count(i++)
i] = trim(i]);
if (content_type[0]="text/plain";
if (stristr(content_type[0],"message/")) {
header) && !stristr(header) {
this->attachments[] = new Pop3Attachment(array("header" => message)));
}
} else {
switch(trim(strtolower(message = nl2br(htmlentities(implode("\n",this->hasPlainText = true;
if (trim(this->plainText = this->htmlText = implode("\n", this->hasHtml = true;
break;
case "multipart":
content_type[1]);
foreach (ct_pars) {
if (stristr(ct_pars = split("=",trim(ct_pars[0]) == "boundary")
ct_pars[1]);
}
}
if(parts = boundary, parts as this->_parsePart(header) {
this->attachments[] = new Pop3Attachment(array("header" => message)));
}
break;
}
}
}
function _textDecode(text) {
switch(dec_text = explode("\n",quoted_printable_decode(implode("\n",i = 0; text); text[text[dec_text = explode("\n",base64_decode(@implode("",dec_text = dec_text;
}
function _splitMultipart(text) {
tmp = array();
foreach(line) {
if (strstr(boundary")) {
tmp;
tmp[]=i=0;parts);parts[parts[parts;
}
function _parsePart(headerpart = array();
noheader = 0;
foreach(riga) {
if (!noheader++;
if (contentpart[] = headerpart[] = contentpart)==0) {
headerpart;
this->_parseEmail(headerpart),explode("\n",trim(implode("\n",
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.