Using PHP's IMAP functions, I want to move 10 messages from the folder "xyz_msg" to the folder "xyz_tmp"
Below is the code I use to connect to the email server.
<?php
$mbox = imap_open ("{imap.gmail.com:993/imap/ssl/novalidate-cert}xyz_tmp", "example@gmail.com", "password")
or die("can't connect: " . imap_last_error());
$imap_obj = imap_check($mbox);
echo "<pre>";
var_dump($imap_obj);
echo "</pre>";
$check = imap_mailboxmsginfo($mbox);
if ($check) {
echo "Date: " . $check->Date . "<br />\n" ;
echo "Driver: " . $check->Driver . "<br />\n" ;
echo "Mailbox: " . $check->Mailbox . "<br />\n" ;
echo "Messages: " . $check->Nmsgs . "<br />\n" ;
echo "Recent: " . $check->Recent . "<br />\n" ;
echo "Unread: " . $check->Unread . "<br />\n" ;
echo "Deleted: " . $check->Deleted . "<br />\n" ;
echo "Size: " . $check->Size . "<br />\n" ;
} else {
echo "imap_check() failed: " . imap_last_error() . "<br />\n";
}
imap_close($mbox);
?>