如何使用PHP将联系人从Gmail添加到Infusionsoft?

I need to create a new contact in Infusionsoft for each new email received in a GMail account. I've setup the following to do the API call to Infusionsoft:

public function addCon($cMap, $optReason = "") {

    $carray = array(
            php_xmlrpc_encode($this->key),
            php_xmlrpc_encode($cMap,array('auto_dates')));
    $conID = $this->methodCaller("ContactService.add",$carray);
    if (!empty($cMap['Email'])) {
        if ($optReason == "") { $this->optIn($cMap['Email']); } else { $this->optIn($cMap['Email'],$optReason); }
    }
    return $conID;
}

How do I query GMail for a list of email addresses, and names, and insert those into my InfusionSoft contact records using PHP?

Why are you not using the PHP SDK from infusionsoft? It will make creating contacts easier in Infusionsoft. http://developers.infusionsoft.com/devkits/iSDK.zip

As for pulling emails from gmail try this: http://davidwalsh.name/gmail-php-imap