|
-
Mar 18th, 2008, 11:43 AM
#1
Thread Starter
Addicted Member
[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
தமிழ்இன்பன்
-
Mar 22nd, 2008, 10:56 PM
#2
Fanatic Member
-
Mar 23rd, 2008, 05:17 AM
#3
Thread Starter
Addicted Member
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, $n, FT_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
தமிழ்இன்பன்
-
Mar 23rd, 2008, 10:39 AM
#4
Fanatic Member
Re: access mail box
What is not working?
What error messages are you getting?
-
Mar 23rd, 2008, 02:09 PM
#5
Thread Starter
Addicted Member
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
தமிழ்இன்பன்
-
Mar 23rd, 2008, 02:35 PM
#6
Fanatic Member
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.
-
Mar 24th, 2008, 12:43 PM
#7
Thread Starter
Addicted Member
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
தமிழ்இன்பன்
-
Mar 24th, 2008, 07:04 PM
#8
Fanatic Member
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|