Login   Register  
PHP Classes
elePHPant
Icontem

im totally lost

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Receive Mail  >  All threads  >  im totally lost  >  (Un) Subscribe thread alerts  
Subject:im totally lost
Summary:lost
Messages:2
Author:komu
Date:2012-02-14 23:56:17
Update:2012-03-05 13:35:17
 

  1. im totally lost   Reply   Report abuse  
Picture of komu
komu
2012-02-14 23:56:17
Hi, Im trying to use your php class (receivemail php class) to
retrieve emails from my gmail account

1. I logged in to my gmail account and made sure pop & imap are
enabled in settings
2. I have wamp server installed on my windows machine, i opened
php.ini and uncommented ;extension=php_imap.dll (so as to enable imap
library) also i uncommented ;extension=php_openssl.dll
3. I downloaded your receivemail php class & copied the two
files(example.php and recivemail.class.php) into
c->wamp->www->myprojects
4. I then made the following changes to the example.php file

// Creating a object of reciveMail Class
$obj= new receiveMail('myusername@gmail.com','mypassword','myusername@gmail.com','imap.gmail.com','imap','143',false);

5. I then resaved the file and i went to
http://localhost/myprojects/example.php on my browser
6. When i click go, the only thing appearing on my browser is;

connect(); //If connection fails give error message and exit // Get
Total Number of Unread Email in mail box $tot=$obj->getTotalMails();
//Total Mails in Inbox Return integer value echo "Total Mails:: $tot
"; for($i=$tot;$i>0;$i--) { $head=$obj->getHeaders($i); // Get Header
Info Return Array Of Headers **Array Keys are
(subject,to,toOth,toNameOth,from,fromName) echo "Subjects ::
".$head['subject']."
"; echo "TO :: ".$head['to']."
"; echo "To Other :: ".$head['toOth']."
"; echo "ToName Other :: ".$head['toNameOth']."
"; echo "From :: ".$head['from']."
"; echo "FromName :: ".$head['fromName']."
"; echo "

"; echo "
*******************************************************************************************
"; echo $obj->getBody($i); // Get Body Of Mail number Return String
Get Mail id in interger $str=$obj->GetAttach($i,"./"); // Get attached
File from Mail Return name of file in comma separated string args.
(mailid, Path to store file) $ar=explode(",",$str); foreach($ar as
$key=>$value) echo ($value=="")?"":"Atteched File :: ".$value."
"; echo "
------------------------------------------------------------------------------------------
"; //$obj->deleteMails($i); // Delete Mail from Mail box }
$obj->close_mailbox(); //Close Mail Box ?>


7. What do you think is the problem? Im I supposed to save the file as
example.php
or should I add some html?
8. Any advice, thoughts or direction will be highly appreciated

Thanks in advance,
Yours,
Komu.

  2. Re: im totally lost   Reply   Report abuse  
Picture of mitul koradia
mitul koradia
2012-03-05 13:35:17 - In reply to message 1 from komu
If you are getting PHP code in your browser output then it is your PHP configuration issue.