Page 1 of 1

imap_mail_move

Posted: Wed Mar 15, 2006 2:21 pm
by UndoUndo_
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


Hi,

I'm reading a POP3 mailbox successfully with imap_open() and collecting information about some of the mails in the mbox but whenever I use imap_mail_move or Imap_mail_copy or even imap_append I get the error:

"not valid for POP3"

Has anyone got experience of this? phpinfo() tells me the imap extensions are complied and I can successfully read mails from the mbox so I'm assuming its my code.

my code:

Code: Select all

$MSGheader = imap_fetchheader($mbox,$val->uid);
$MSGbody = imap_fetchbody($mbox,$val->uid,'1');

$mbox1 = imap_open($forwardto[$i][0] , $forwardto[$i][1], $forwardto[$i][2])or die("can't connect: " . map_last_error());
$numMSG = imap_check($mbox1);
echo 'initial number of messages ='.$numMSG->Nmsgs.'<br />';

$moveMSG = imap_append($mbox1,"{mail.thewoom.com:110/pop3/notls}","$MSGheader\r\n","$MSGbody\r\n")or die("can't connect: " . imap_last_error());

echo 'move msg'.var_dump($moveMSG).'<br />';
$numMSG = imap_check($mbox1);

echo 'initial number of messages ='.$numMSG->Nmsgs.'<br />';
imap_close($mbox1).'<br />';
thanks


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Wed Mar 15, 2006 2:33 pm
by UndoUndo_
sorry, feyd point taken :)