Thread: PHP and IMAP

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    27
    Rep Power
    0
    Right now i am writing an IMAP client with php.

    the start is made, and i ge all the folder listings and headers and all, but how do i read a message ???

    could anyone help me out on this one ??
    (and i don't want to use externel libs)
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Denmark
    Posts
    4
    Rep Power
    0
    echo "<p><h1>body i mail</h1>n";

    $i=1;

    $body = imap_body ($mbox, $i);
    $um_msg = imap_num_msg ($mbox);

    if ($body == false) {
    echo ("Call failed<br>n");
    }


    else {

    while(($ii++)<=$num_msg)
    {
    $i++;
    $body = imap_body ($mbox, $i);
    echo $body."<br>n";
    }


    }
  4. #3
  5. No Profile Picture
    Robert_J_Sherman
    Guest
    Devshed Newbie (0 - 499 posts)
    Sure, that will probably get you the body, but the real difficult part is decoding attachments, in a human "linked" form.. for that you'll find you have to make use of the imap_fetch_structure() function, and decode the message appropriately..

    For me, that's been my hang-up from completing my mail client.. and I can't seem to find a real good tutorial which walks one through the process.. which would be a big help.

    Sure, I've found a few classes, but even there, the authors don't seem to really explain them, etc..

    ------------------
    SnR Graphics,
    Low Cost Hosting and Web Development.
  6. #4
  7. No Profile Picture
    wangjun
    Guest
    Devshed Newbie (0 - 499 posts)
    I feel pityful to be denied to the website you suppled.
    What 's its functions?

    I am really interested in your work, and I am prepared to do it ,too.

    Have you implement receive mail in PHP4 (linux) ?
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    27
    Rep Power
    0
    Thanks for all your replies, and i finally got the whole thing working fine, except the attachments, but i haven't worked on that yet.
    I've got an example for the decoding, but i haven't implemented it in my source.
    The whole rest of the client works fine now, including a set of standard colors that can be chosen by the user.

    It really looks neat, and if someone is interested in the basics of IMAP and PHP on a linux box, you can just send me a e-mail

    Tnx Guys, Wouter Rusman

    ------------------
    don't blame me, im blond
    :-)
  10. #6
  11. No Profile Picture
    wangjun
    Guest
    Devshed Newbie (0 - 499 posts)
    I dont know your email box. Can U tell me?
    And can u give a copy of it to me. I 'm working on it,too.

Similar Threads

  1. php with imap configuration issue
    By sumesh in forum PHP Development
    Replies: 1
    Last Post: May 13th, 2004, 06:14 AM
  2. Replies: 0
    Last Post: February 2nd, 2004, 06:44 PM
  3. Using PHP to email via Exchange
    By Methias in forum PHP Development
    Replies: 1
    Last Post: January 30th, 2004, 11:30 AM
  4. Replies: 1
    Last Post: January 15th, 2004, 06:16 AM
  5. PHP Array strings (IMAP used here)
    By Thyme3333 in forum PHP Development
    Replies: 2
    Last Post: January 14th, 2004, 11:12 AM

IMN logo majestic logo threadwatch logo seochat tools logo