/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php /* mig - a command line PHP tool for transfering emails from one host to another. Created by Kaspars Dambis http://konstruktors.com */ function m_connect() { global $msrc, $mdst; // FROM '{mail.example.lv:143/imap/novalidate-cert}', // host 'pass123') // password // TO '{imap.gmail.com:993/imap/ssl/novalidate-cert}', // host 'pass123') // password } // Go! m_connect(); $start = 1; $end = 1; // Find the last message transfered $start = $dst_status->Nmsgs; } // Check how many messages are the source. $end = $src_status->Nmsgs; } echo "Getting destination mailbox address...\n"; echo "Started! - start: $start / end: $end"; for ($i = $start; $i <= $end; $i++) { // Check if we are still connected if (($i - $start) % 5 == 0) { echo "\n\n Connection lost! Trying to reconnect ...\n\n"; m_connect(); } else { echo "\n\n Connection OK! \n\n"; } } // Check if message doesn't exist at the destination echo "\n" . $i . " / $end" . "\n from: " . $m->fromaddress . "\n to: " . $m->toaddress . "\n subject: " . $m->subject . "\n size: " . format_size($m->Size) . "\n date: " . $m->date . "\n\n"; } } } echo "Ended!\n"; function format_size($size) { if ($size == 0) { return('n/a'); } else { } ?>