Ejemplo n.º 1
0
// echo "this this date after applying strtotimes {$payment_date}";
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
echo "<pre>";
// print_r($field_data);
foreach ($myarray as $key => $allcompanyval) {
    $company_id = $allcompanyval["company_id"];
    $varfs = "";
    $obj = new Mailbox($allcompanyval["hspemail"], getPassword($allcompanyval["hsppassword"]));
    $jobarray = $obj->initClass();
    if ($jobarray) {
        $var = $obj->checkimapp();
        $result = $obj->insertJobsFromMail($jobarray, $company_id);
        if ($result) {
            echo "Yes Inserted <br>";
        } else {
            echo "Not Inserted";
        }
    }
    //echo $varfs;
    $obj->disconnect();
}
// $hostname = "{imap.gmail.com:993/imap/ssl}INBOX";
// $username = "******"; # e.g somebody@gmail.com
// $password = "******";
/* connect to gmail with your credentials */
// $hostname = "{imap.gmail.com:993/imap/ssl}INBOX";
// $username = "******"; # e.g somebody@gmail.com