imap_mail_move

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
UndoUndo_
Forum Newbie
Posts: 2
Joined: Wed Mar 15, 2006 2:14 pm

imap_mail_move

Post 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]
UndoUndo_
Forum Newbie
Posts: 2
Joined: Wed Mar 15, 2006 2:14 pm

Post by UndoUndo_ »

sorry, feyd point taken :)
Post Reply