Jump to content

meomike2000

Members
  • Posts

    171
  • Joined

  • Last visited

    Never

Everything posted by meomike2000

  1. i use this sample: $structure = imap_fetchstructure($this->mail,$this->messId); if (!$structure->parts) { // not multipart $body = $this->getPart($s,0); }else { // multipart: iterate through each part $plainmsg = false; $htmlmsg = false; $attachment = Array(); foreach ($structure->parts as $partno0 => $p) { $piece = $this->getPart($p,$partno0+1); if ($piece['type'] == 'attachment') { $attachment[] = $piece['fileName']; //$body['attachment'] = $piece['fileName'];//$this->getPart($p,$partno0+1); }else{ if ($piece['type'] == 'plain') { $plainmsg = $this->formatMessage($piece['body']); } if ($piece['type'] == 'html') { $htmlmsg = $this->formatMessage($piece['body']); } } } if ($attachment) {$body['attachment'] = $attachment;} if ($plainmsg && $htmlmsg) { $body['body'] = ($this->userChoice == 'html') ? $htmlmsg : $plainmsg; //$body['body'] = $piece['type']; }else{ $body['body'] = ($htmlmsg) ? $htmlmsg : $plainmsg; //$data = ($partno > 0) ? imap_fetchbody($mbox,$mid,$partno) : imap_body($mbox,$mid); } } and the piece from $this->getPart($p,$partno0+1); that handles attachment...... // ATTACHMENT // Any part with a filename is an attachment, // so an attached text file (type 0) is not mistaken as the message. if ($params['filename'] || $params['name']) { // filename may be given as 'Filename' or 'Name' or both $filename = ($params['filename'] || $params['name']) ? $params['filename'] : $params['name']; $body['type'] = 'attachment';//$data; $body['fileName'] = $filename; $body['fileData'] = $data; } hope this helps
  2. workin on an email program and i need help with the attachments. were r the stored or how do i make a link to them for downloading, i have searched my email directory and can not find them..... any help would be great. thanks mike
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.