Is there simple email client script using PHP , IMAP?

Posted on 2011-10-04
Last Modified: 2012-05-12
Can any one give some sample work around or script to display the emails from any email account. ? It is a email client like SquirrelMail or Horde .. but these looks big and more there... I need to display the mail with view more+see the attachment of any email ID or inbox.

Please help.

I referred this, but not much help ...simple mail
Question by:Loganathan Natarajan
    LVL 11

    Accepted Solution

    This works :

    # localhost pop3 with and without ssl
    # $authhost="{localhost:995/pop3/ssl/novalidate-cert}";
    # $authhost="{localhost:110/pop3/notls}";
    # localhost imap with and without ssl
    # $authhost="{localhost:993/imap/ssl/novalidate-cert}";
    # $authhost="{localhost:143/imap/notls}";
    $mbox = imap_open($authhost, "<username>", "<password>");
    echo "<h1>Mailboxes</h1>\n";
    $folders = imap_listmailbox($mbox, "{<hostname>:143}", "*");
    if ($folders == false) {
        echo "Call failed<br />\n";
    } else {
        foreach ($folders as $val) {
            echo $val . "<br />\n";
    echo "<h1>Headers in INBOX</h1>\n";
    $headers = imap_headers($mbox);
    if ($headers == false) {
        echo "Call failed<br />\n";
    } else {
        foreach ($headers as $val) {
            echo $val . "<br />\n";

    Open in new window

    LVL 36

    Author Closing Comment

    by:Loganathan Natarajan

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now