954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Fetching Imap Error

I'm creating a web-based mail client from scratch using PHP IMAP library. What I need to implement right now is fetch the error and display it in a fancy way(ex. pop up in the view when error occured). How am i going to do this?

This is a sample of what I tried to do but attained no success because a line(s) of error message(s) still display on the page.

try{     
    self::$conn = imap_open(self::$imappath, self::$mailuser, self::$mailpassword);
}
catch (Exception $e){
    $_SESSION['imap_error']="IMAP connect failed.";
}


in my view I have this:

if (isset($_SESSION['imap_error']) && ($_SESSION['imap_error']!=""))
{
?>
<script type="text/javascript">
$('.classname').fadeIn('slow');
$('.span_name').html("<?php echo ($_SESSION['imap_error']);?>");
</script>
<?php
}


How am i goin to completely remove of the error message generated by php/imap and just return or pass my own error message [session] to my view?

Thanks for the help!

itsgrace
Newbie Poster
2 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: