I trying to save the record of the subscriber to mail chimp in php, but i'm getting this error of which i don't understand:
fsockopen(): php_network_getaddresses: getaddrinfo failed: No such host is known.
I'm using MCAPI class version 1.3
here is my code to save:
$apikey='d9750fc48519551e22e789c1gthy050a5-fd7'; // Enter your API key
$api = new MCAPI($apikey);
$retval = $api->lists();
$listid='d395e7afr4'; // Enter list Id here
$fname = $this->stepdata['yourName'];
$lname = $this->stepdata['yourName'];
$email = $this->stepdata['yourEmail'];
// By default this sends a confirmation email - you will not see new members
// until the link contained in it is clicked!
$merge_vars = array('FNAME' => $fname, 'LNAME' => $lname, 'EMAIL' => $email);
//listSubscribe'=>array("id","email_address","merge_vars","email_type","double_optin","update_existing","replace_interests","send_welcome")
if($api->listSubscribe($listid, $email, $merge_vars, $email_type='html', $double_optin=false, $update_existing=false, $replace_interests=false, $send_welcome=true ) === true) {
}
This is where the error is pointing at on MCAPI class
ob_start();
if ($this->secure){
$sock = fsockopen("ssl://".$host, 443, $errno, $errstr, 30);
} else {
$sock = fsockopen($host, 80, $errno, $errstr, 30);
}
Thanks