Changeset 2106 for branches/2.0/expressoMail1_2
- Timestamp:
- 03/01/10 16:56:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/expressoMail1_2/inc/class.imap_functions.inc.php
r2103 r2106 709 709 } 710 710 711 $content = ''; 712 if (strtolower($msg->structure[$msg_number]->subtype) == "plain") 711 $content = $this->decodeBody( 712 imap_body( $this -> mbox, $msg_number, FT_UID ), 713 $msg -> encoding[ $msg_number ][ 0 ], 714 $msg -> charset[ $msg_number ][ 0 ] 715 ); 716 717 if ( strtolower( $msg -> structure[ $msg_number ] -> subtype ) == 'plain' ) 713 718 { 714 $content .= '<span style="font-family: monospace">' . nl2br($this->decodeBody((imap_body($this->mbox, $msg_number, FT_UID)), $msg->encoding[$msg_number][0], $msg->charset[$msg_number][0])) . '</span>'; 715 } 716 else if (strtolower($msg->structure[$msg_number]->subtype) == "html") 717 { 718 $content .= $this->decodeBody(imap_body($this->mbox, $msg_number, FT_UID), $msg->encoding[$msg_number][0], $msg->charset[$msg_number][0]); 719 $content = str_replace( array( '<', '>' ), array( ' #$<$# ', ' #$>$# ' ), $content ); 720 $content = nl2br( htmlentities( $content ) ); 721 $content = $this -> replace_links( $content ); 722 $content = str_replace( array( ' #$<$# ', ' #$>$# ' ), array( '<', '>' ), $content ); 723 $content = '<span style="font-family: monospace">' . $content . '</span>'; 724 725 $return[ 'body' ] = $content; 726 727 return $return; 719 728 } 720 729 } … … 778 787 $att = new imap_attachment(); 779 788 $attachments = $att -> get_attachment_info($this->mbox,$msg_number); 780 if($attachments['number_attachments'] > 0) { 781 foreach($attachments ['attachment'] as $index => $attachment){ 782 if(strtolower($attachment['type']) == "delivery-status" || 783 strtolower($attachment['type']) == "rfc822" || 784 strtolower($attachment['type']) == "rfc822-headers" || 785 strtolower($attachment['type']) == "plain" 786 ){ 787 $obj = imap_rfc822_parse_headers(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID), $msg->encoding[$msg_number][$values]); 788 $content .= "<hr align='left' width='95%' style='border:1px solid #DCDCDC'>"; 789 $content .= "<br><table style='margin:2px;border:1px solid black;background:#EAEAEA'>"; 790 $content .= "<tr><td><b>".$this->functions->getLang("Subject").":</b></td><td>".$this->decode_string($obj->subject)."</td></tr>"; 791 $content .= "<tr><td><b>".$this->functions->getLang("From").":</b></td><td>".$this->decode_string($obj->from[0]->mailbox."@".$obj->from[0]->host)."</td></tr>"; 792 $content .= "<tr><td><b>".$this->functions->getLang("Date").":</b></td><td>".$obj->date."</td></tr>"; 793 $content .= "<tr><td><b>".$this->functions->getLang("TO").":</b></td><td>".$this->decode_string($obj->to[0]->mailbox."@".$obj->to[0]->host)."</td></tr>"; 794 $content .= !$obj->cc ? "</table><br>" :"<tr><td><b>".$this->functions->getLang("CC").":</b></td><td>".$this->decode_string($obj->cc[0]->mailbox."@".$obj->cc[0]->host)."</td></tr></table><br>"; 795 $content .= $this->decodeBody( 796 imap_fetchbody( 797 $this->mbox, 798 $msg_number, 799 ( $attachment['part_in_msg'] + ( 800 ( strtolower( $attachment[ 'type' ] ) == 'delivery-status' ) ? 0 : 1 ) 801 ) . ".1", 802 FT_UID 803 ), 804 $msg->encoding[ $msg_number ][ $values ], 805 $msg->charset[ $msg_number ][ $values ] 806 ); 807 break; 789 if($attachments['number_attachments'] > 0) { 790 foreach($attachments ['attachment'] as $index => $attachment) 791 { 792 if ( in_array( strtolower( $attachment[ 'type' ] ), array( 'delivery-status', 'rfc822', 'rfc822-headers', 'plain' ) ) ) 793 { 794 $obj = imap_rfc822_parse_headers( imap_fetchbody( $this -> mbox, $msg_number, $msg_part, FT_UID ), $msg -> encoding[ $msg_number ][ $values ] ); 795 796 $content .= '<hr align="left" width="95%" style="border:1px solid #DCDCDC">'; 797 $content .= '<br><table style="margin:2px;border:1px solid black;background:#EAEAEA">'; 798 799 $content .= '<tr><td><b>' . $this->functions->getLang("Subject") 800 . ':</b></td><td>' .$this->decode_string($obj->subject) . '</td></tr>'; 801 802 $content .= '<tr><td><b>' . $this -> functions -> getLang( 'From' ) . ':</b></td><td>' 803 . $this -> replace_links( $this -> decode_string( $obj -> from[ 0 ] -> mailbox . '@' . $obj -> from[ 0 ] -> host) ) 804 . '</td></tr>'; 805 806 $content .= '<tr><td><b>' . $this->functions->getLang("Date") . ':</b></td><td>' . $obj->date . '</td></tr>'; 807 808 $content .= '<tr><td><b>' . $this -> functions -> getLang( 'TO' ) . ':</b></td><td>' 809 . $this -> replace_links( $this -> decode_string( $obj -> to[ 0 ] -> mailbox . '@' . $obj -> to[ 0 ] -> host ) ) 810 . '</td></tr>'; 811 812 if ( $obj->cc ) 813 $content .= '<tr><td><b>' . $this -> functions -> getLang( 'CC' ) . ':</b></td><td>' 814 . $this -> replace_links( $this -> decode_string( $obj -> cc[ 0 ] -> mailbox . '@' . $obj -> cc[ 0 ] -> host ) ) 815 . '</td></tr>'; 816 817 $content .= '</table><br>'; 818 819 820 $id = ( ( strtolower( $attachment[ 'type' ] ) == 'delivery-status' ) ? false : true ); 821 if ( strtolower( $msg->structure[$msg_number]->parts[1]->parts[0]->subtype ) == 'plain' ) 822 { 823 $id = !$id; 824 if ( $msg->structure[$msg_number]->parts[1]->parts[0]->encoding == 4 ) 825 $msg->encoding[ $msg_number ][ $values ] = 'quoted-printable'; 826 } 827 828 $body = $this->decodeBody( 829 imap_fetchbody( 830 $this->mbox, 831 $msg_number, 832 ( $attachment['part_in_msg'] + ( ( int ) $id ) ) . ".1", 833 FT_UID 834 ), 835 $msg->encoding[ $msg_number ][ $values ], 836 $msg->charset[ $msg_number ][ $values ] 837 ); 838 839 if ( strtolower( $msg->structure[$msg_number]->parts[1]->parts[0]->subtype ) == 'plain' ) 840 { 841 $body = str_replace( array( '<', '>' ), array( ' #$<$# ', ' #$>$# ' ), $body ); 842 $body = nl2br( htmlentities( $body ) ); 843 $body = $this -> replace_links( $body ); 844 $body = str_replace( array( ' #$<$# ', ' #$>$# ' ), array( '<', '>' ), $body ); 845 $body = '<span style="font-family: monospace">' . $body . '</span>'; 846 } 847 848 $content .= $body; 849 break; 808 850 } 809 851 }
Note: See TracChangeset
for help on using the changeset viewer.