Reputation: 3541
I'm trying to fetching email from particular email account. When i'm adding correct email address and password then it works fine, but when giving wrong details then its returning lots of notice
and warning
errors. I added @
for preventing the some errors, it works some errors are hided but some are not hiding, even the error does not showing line number as well. Below is my code
$mbox = @imap_open("{mail.b*********n.com:143/novalidate-cert}", $sEmail, $sPwd);
$MC = @imap_check($mbox);
$result = @imap_fetch_overview($mbox,"1:{$MC->Nmsgs}",0);
if(isset($result)){
foreach ($result as $overview) {
//echo "#{$overview->msgno} ({$overview->date}) - From: {$overview->from}
//{$overview->subject}\n";
$a = "From: {$overview->from}";
$s = explode('<',$a);
if(isset($s[1])){
//echo $s[1].'<br />';
echo rtrim($s[1],'>').'<br />';
}
}
}
@imap_close($mbox);
Errors:
( ! ) Notice: Unknown: [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
( ! ) Notice: Unknown: [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
( ! ) Notice: Unknown: [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
( ! ) Notice: Unknown: Too many login failures (errflg=2) in Unknown on line 0
Can someone guide me why these errors are showing and how can i fix the issue. I would like to appreciate.
Upvotes: 1
Views: 510
Reputation: 165
Have you tried to use
<? error_reporting(E_ALL & ~E_NOTICE); ?>
This will allow php to report everything except Notice.
Upvotes: 2