Results 1 to 8 of 8

Thread: [RESOLVED] access mail box

  1. #1

    Thread Starter
    Addicted Member thamizhinpan's Avatar
    Join Date
    Dec 2005
    Location
    TE
    Posts
    243

    Resolved [RESOLVED] access mail box

    I would like to access mail box of gmail account.
    How can I do it? If you have any ideas please share it with me?
    If you can give sample source code on PHP, it'll be more use full and easy for me?
    If above question or answer will help to you
    Don't forget to rate me
    தமிழ்இன்பன்

  2. #2
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: access mail box

    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  3. #3

    Thread Starter
    Addicted Member thamizhinpan's Avatar
    Join Date
    Dec 2005
    Location
    TE
    Posts
    243

    Re: access mail box

    Thank you.
    But I have already visited to this page and I have written a code with their help like this.
    PHP Code:
    <?php
        
    //connect to IMAP server
        
    $imap imap_open ("{imap.gmail.com:993/imap/ssl}INBOX""[email protected]""abcdef")
         or die(
    "can't connect: " imap_last_error());
         

        
    //get the number of messages in the INBOX
        
    $check imap_check($imap);
        print(
    "$check->Nmsgs messages<br>\n");
        print(
    "$check->Recent new messages<br>\n");
        print(
    "Most Recent Message: $check->Date<br>\n");

        for(
    $n=1$n <= $check->Nmsgs$n++)
        {
            
    $header imap_headerinfo($imap$n);
            
    $body imap_body($imap$nFT_INTERNAL FT_PEEK);
            print(
    "<hr>\n");

            
    $to = array();
            foreach(
    $header->to as $t)
            {
                
    $to[] = "$t->personal <$t->mailbox@$t->host>";
            }
            
    $to implode(","$to);

            
    $from = array();
            foreach(
    $header->from as $f)
            {
                
    $from[] = "$f->personal <$f->mailbox@$f->host>";
            }
            
    $from implode(","$from);


            print(
                
    "Date: $header->date<br>\n" .
                
    "To: " htmlentities($to) . "<br>" .
                
    "From: " htmlentities($from) . "<br>\n" .
                
    "Subject: $header->subject<br>\n" .
                
    "<br>\n" .
                
    nl2br(htmlentities($body)) . "<br>\n");
        }

        
    //close connection
        
    imap_close($imap);
    ?>
    But this is not working
    If above question or answer will help to you
    Don't forget to rate me
    தமிழ்இன்பன்

  4. #4
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: access mail box

    What is not working?
    What error messages are you getting?
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  5. #5

    Thread Starter
    Addicted Member thamizhinpan's Avatar
    Join Date
    Dec 2005
    Location
    TE
    Posts
    243

    Re: access mail box

    I got this error
    Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX in e:\MyServer\apache group\Apache\htdocs\MyTest\Test 1.php on line 3
    can't connect: Can't open mailbox {imap.gmail.com:993/imap/ssl}INBOX: invalid remote specification
    If above question or answer will help to you
    Don't forget to rate me
    தமிழ்இன்பன்

  6. #6
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: access mail box

    This is what I use to connect to pop3:
    pop.gmail.com:995/pop3/ssl/novalidate-cert}INBOX
    I wonder if you need SSL installed or something...
    But try connecting using that, if you still get an error, then I might be right.
    But that works fine under a linux system.
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  7. #7

    Thread Starter
    Addicted Member thamizhinpan's Avatar
    Join Date
    Dec 2005
    Location
    TE
    Posts
    243

    Re: access mail box

    I think you may right.
    Because I have tried POP also. But it is worth less.
    So I want install SSL. But Can I do it for my local server?
    If above question or answer will help to you
    Don't forget to rate me
    தமிழ்இன்பன்

  8. #8
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: [RESOLVED] access mail box

    Of course. Someone probably has an OpenSSL package out there. If I am right all you need to do is install that and you should be good...
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width