Having problems with IMAP extension
Posted: Fri Sep 27, 2002 10:54 pm
here is my code:
now, the problem that im having, is that i am getting nothing from the imap_header function. The objects it returns seem to be null. When i attempt to print $head->Subject; i get nothing, when i try to print $head->fromaddress; i get nothing, but when i print body, i get the whole body. Can someone please point me in the right direction??!
Maybe another way to connect to a pop server?
Code: Select all
<?php
$mailserver = "pop server";
$port = "110";
$username = "user";
$password = "password";
$mail = imap_open("{".$mailserver."/pop3:".$port."}", $username, $password);
$number = imap_num_msg($mail);
$x=1;
while ($x <= $number){
$body = imap_body($mail, $x);
$head = imap_header($mail, $x);
if(!isset($head->Subject)) {
$header->Subject = "No Subject";
}
print $head->Subject;
print $head->fromaddress;
print $body;
$x=$x+1;
}
?>Maybe another way to connect to a pop server?