Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I hate IMAP_OPEN!

Status
Not open for further replies.

ronnyjljr

IS-IT--Management
Joined
Nov 23, 2003
Messages
249
Location
US
Argh,

My problem is that the page just stops at a cetain html code directly before the imap_open call.

I am really confused on thise on:
Username: ron
Password: james

I can't figure it out, this is the code I'm using: $pop_connect = imap_open("{mail.ledwichmedia.com:110/pop3/notls}INBOX",$accountfull,$password,OP_HALFOPEN) or die("Can not connect to POP mailbox");
$message_total = imap_num_msg($pop_connect);

If I take this out, all the html is displayed correctly but no php stuff because the php code is missing. I have spent hours trying to figure this one out. I have no idea.

This is the full code:

<td><table width=&quot;700&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><table width=&quot;700&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<tr bgcolor=&quot;#333333&quot; class=&quot;whitetext&quot;>
<td width=&quot;57&quot;><div align=&quot;center&quot;>Delete</div></td>
<td width=&quot;265&quot;>Subject</td>
<td width=&quot;136&quot;>Sender</td>
<td width=&quot;60&quot;><div align=&quot;center&quot;>Size</div></td>
<td width=&quot;73&quot;><div align=&quot;center&quot;>Date</div></td>
<td width=&quot;109&quot;><div align=&quot;center&quot;>Attachment(s)</div></td>
</tr>

<?

$pop_connect = imap_open(&quot;{mail.ledwichmedia.com:110/pop3/notls}INBOX&quot;,$accountfull,$password,OP_HALFOPEN) or die(&quot;Can not connect to POP mailbox&quot;);
$message_total = imap_num_msg($pop_connect);
if ($message_total==0){
echo &quot;<tr bgcolor=\&quot;#999999\&quot;>&quot;;
echo &quot;<td colspan=\&quot;6\&quot;><div align=\&quot;center\&quot; class=\&quot;whitetext style12\&quot;>No Messages To Display </div></td></tr>&quot;;
}
else{
for($i=$message_total;$i>0;$i--){
$message_info = imap_header($pop_connect,$i);
$email_from = substr($message_info->fromaddress,0,19);
if (strlen($message_info->Subject)>1) $email_subject = substr($message_info->Subject,0,30);
else $email_subject =&quot;No Subject&quot;;
$email_date = substr($message_info->Date,5,11);
echo &quot;<tr bgcolor=\&quot;#999999\&quot;>&quot;;
echo &quot;<td><div align=\&quot;center\&quot;><input type=\&quot;checkbox\&quot; name=\&quot;$x\&quot; value=\&quot;DELETE\&quot;></div></td>&quot;;
echo &quot;<td class=\&quot;whitetext\&quot;>$email_subject</td>&quot;;
echo &quot;<td class=\&quot;whitetext style11\&quot;>$email_from</td>&quot;;
echo &quot;<td class=\&quot;whitetext\&quot;><div align=\&quot;center\&quot;>SIZE</div></td>&quot;;
echo &quot;<td class=\&quot;whitetext\&quot;><div align=\&quot;center\&quot;>$email_date</div></td>&quot;;
echo &quot;<td class=\&quot;whitetext\&quot;><div align=\&quot;center\&quot;>Shrug</div></td></tr>&quot;;
}
}
imap_close($pop_connect);
?>

</table> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table> </td>
</tr>
<tr>

Any help at all?

-Ron
 
It worked fine for me at 2004-01-09 8:05 CST

Just to clarify...

You have verified that the imap_open() invokation is the problem, right? It works up to there?

Could it be DNS? Have you tried hard-coding the server IP address?



Want the best answers? Ask the best questions: TANSTAAFL!!
 
You are probably right about the DNS, I noticed that it worked this morning when I tried it initially, but when you go back two or three times it does it's thing. I'll hard code the IP and get back to you.

Thanks a bunch!
-Ron
 
You my friend area genious, that is exactly what the problem was. Cheers!

-Ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top