PHP Classes

File: sample.usage.php

Recommend this page to a friend!
  Classes of Alexander   Email attachments reader (IMAP/POP3)   sample.usage.php   Download  
File: sample.usage.php
Role: Example script
Content type: text/plain
Description: Howto
Class: Email attachments reader (IMAP/POP3)
Retrieve file attachments from e-mail messages
Author: By
Last change:
Date: 12 years ago
Size: 529 bytes


Class file image Download

// This script saves all attachments from all emails into a $save_to folder with original filenames

require './class.AReader.php';

$save_to = '/tmp';

$mbox = new AReader($host, $user, $password);
    if (!
$mbox->Connect()) {
'Unable to establish connection with mailbox');
    while (
$mbox->FetchMail()) {
        if (
$mbox->HasAttachment()) {
$mbox->FetchAttachment()) {
$data = $mbox->SaveAttachment($save_to);