Welcome Guest, Not a member yet? Register   Sign In
imap_pop , array problem .
#1

[eluser]nebi[/eluser]
Hi!

I am using the imap_pop lib and using the example from the wiki and made a small modify


Code:
$this->load->library('imap_pop');
// this is your pop server host and domain name
$config['server']='xxx:110';
$config['login']='xxx';
$config['pass']='xxxx';
// you may have to look up the imap functions at PHP.net
// to get the right set of service flags here
$config['service_flags'] = '/pop3/notls';
$config['mailbox']= 'INBOX';
$msg_count = $this->imap_pop->connect_and_count($config);
$em = $this->imap_pop->grab_email_as_array(1);
$this->imap_pop->close();
//print_r($em);
$this->load->view('email_view', $em);

email_view.php :

Code:
<html>
<head><title>EMAIL</title></head>
<body>

<?=$text?>

</body>
</html>


Error code :
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: text

Filename: views/email_view.php

Line Number: 5

I trying to get the messasage text from the mail from the array but no luck .
#2

[eluser]acoda[/eluser]
Hi nebi,

Had a quick look at this for you and if you change your view file to this:
Code:
<html>
<head><title>EMAIL</title></head>
<body>

<?=$strings['text']?>

</body>
</html>

You should see the massage text from your e-mail. You just miss read the array and referenced it wrong, easily done.
#3

[eluser]nebi[/eluser]
Thanks acoda , it works great!




Theme © iAndrew 2016 - Forum software by © MyBB