Mailchimp Upcoming API security change in HTTPS to communcate with mailchimp account.
below is the code about update the API key into config file.
//API Key - see http://admin.mailchimp.com/account/api
$apikey = 'f4f4f4f4d3d3d3d3d3ds2s2s2s2s-us7';
// A List Id to run examples against. use lists() to view all
// Also, login to MC account, go to List, then List Tools, and look for the List ID entry
$listId = 'f33ddfgftrfg';
// A Campaign Id to run examples against. use campaigns() to view all
// $campaignId = 'mailchimp1f6bf8709be9f4aa1f6f5749a.947e88ab6a';
$campaignId = 'r3332sssssb6a';
//some email addresses used in the examples:
//$my_email = 'sample@expertwebworld.com';
//$boss_man_email = 'support@expertwebworld.com';
//just used in xml-rpc examples
$apiUrl = 'http://api.mailchimp.com/1.3/';
Due to HTTPS change xml rpc URL
http://api.mailchimp.com/1.3/
into
https://api.mailchimp.com/1.3/
include mail chimp class into php mail sending form
require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey
insert below php code after submit the form, into action script
$api = new MCAPI($apikey);
$merge_vars = array('FNAME'=>$_POST['Name'], 'LNAME'=>$_POST['Name'],
// 'GROUPINGS'=>array(
// array('name'=>'Your Interests:', 'groups'=>'Bananas,Apples'),
// array('id'=>22, 'groups'=>'Trains'),
//s )
);
// By default this sends a confirmation email - you will not see new members
// until the link contained in it is clicked!
$my_email = $_POST['Email'];
$boss_man_email = 'mailchimp@expertwebworld.com';
//$boss_man_email = 'mailchimp2@expertwebworld.com';
$retval = $api->listSubscribe( $listId, $my_email, $merge_vars );
if ($api->errorCode)
{
$mailchimperror='Error in newsletter subscription.';
// echo "Unable to load listSubscribe()!n";
//echo "tCode=".$api->errorCode."n";
//echo "tMsg=".$api->errorMessage."n";
} else {
$mailchimperror= "Subscribed - look for the confirmation email!n";
}