Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
$user = 'xxxx'; // pop3 user name
$pwd = 'xxxx'; // pop3 password
$hst = 'example.com'; // host address
$mbox = imap_open ('{'.$hst.':110/pop3}INBOX', $user, $pwd);
$headers = imap_headers($mbox);
if (imap_num_msg($mbox) == 0) exit();
// Include MySQL database information
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Unable to connect!");
$db = mysql_select_db($dbname);
for ($i = 1; $i <= imap_num_msg($mbox); $i++)
{
$qtmp = array();
$header = imap_headerinfo($mbox, $i, 80, 80);
$msg_date = $header->Date;
$from = $header->from;
foreach ($from as $id => $object) {
$fromname = $object->personal;
$fromaddress = $object->mailbox . "@" . $object->host;
}
// $qtmp[] = ($qtmp will be used to create the query
$messageBody = imap_body($mbox, $i);
$tmp = explode(',',$messageBody);
$q = 'insert into mysql_table set ';
$q .= implode(',',$qtmp);
echo $q."\n";
mysql_query($q) or die(mysql_error());
imap_delete($mbox,$i);
}
imap_expunge($mbox);
imap_close($mbox);
?>