Mail gun Cc header issue

By : Nith

Am using this function to sent bulk mail through mail gun

`//sending batch mail public function BatchMail($subject=null,$body=null, $record=null) { # Instantiate the client. $mg = new Mailgun(MAILGUN_KEY); $domain = MAILGUN_DOMAIN;

    # Next, instantiate a Message Builder object from the SDK, pass in your sending domain
        $batchMsg = $mg->BatchMessage($domain);

        # Define the from address.
        $batchMsg->setFromAddress(FROM_EMAIL, array("first"=>FIRST_NAME, "last" => LAST_NAME));

        # Define the subject. 

        # Define the body of the message.

        # Next, let's add a few recipients to the batch job.
        foreach ($record as $key => $rec) {

            $batchMsg->addToRecipient($rec['email'], array("first" => $rec['fname'], "last" => $rec['lname']));
        $batchMsg->addCcRecipient("[email protected]", array("first" => "Sally", "last" => "Doe"));

        $re     = $batchMsg->finalize();
        $result = $batchMsg->getMessage();

        $log    = $mg->get("$domain/log");
        $respbody = $log->http_response_body;
        $result = $mg->get("$domain/stats",array('event' => array('sent', 'opened')));
        $resp   = $log->http_response_code;
        //$event  = $mg->get("$domain/events");
        $response = array("log"=>$log,"result"=>$result,"body"=>$respbody,"code"=>$resp);
        return  $response;

Here mails are sending properly but I have a problem in my cc mail.

$batchMsg->addCcRecipient("[email protected]", array("first" => "Sally", "last" => "Doe"));

This function using for adding CC mails. Mails are delivering properly but the mail reviving with headers like To: [email protected], Cc:[email protected] But the recipients mails are not listing in the headers.

Normally gamil showing recipients in the headers like this to: [email protected] cc: [email protected]

Anyone know why mail gun showing issue like this ??

By : Nith



   foreach ($record as $key =
By : jarederaj

This video can help you solving your question :)
By: admin