gaza165 Posted June 9, 2009 Share Posted June 9, 2009 <? function __construct($host, $user, $pass, $type = 'imap', $mbox = 'INBOX', $port = null) { $this->host = $host; $this->user = $user; $this->pass = $pass; $this->type = strtolower($type); if (is_null($port)) { switch($this->type) { case 'imap' : $this->port = 143; break; case 'pop3' : $this->port = 110; break; case 'nntp' : $this->port = 119; break; } } else { $this->port = $port; } $this->mbox = $mbox; $mailbox = "$this->host:$this->port/$this->type"; $this->mh = imap_open("{" . $mailbox . "}$this->mbox", $this->user, $this->pass, 16); } ?> what i want is an error check to see if the imap_open connected properly and display the relevant messages. help?? Link to comment https://forums.phpfreaks.com/topic/161496-need-help-with-validation/ Share on other sites More sharing options...
Mark Baker Posted June 9, 2009 Share Posted June 9, 2009 $this->mh = imap_open("{" . $mailbox . "}$this->mbox", $this->user, $this->pass, 16); if ($this->mh === false) { $errors = imap_errors(); // $errors is an array } Link to comment https://forums.phpfreaks.com/topic/161496-need-help-with-validation/#findComment-852246 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.