7

This issue really driving me crazy this past hours. Why is the email that send with Mandrill not showing the right information about the Cc email address.

So for example, I want to send email to

  • receiver_to_a@mail.com
  • receiver_cc_a@mail.com
  • receiver_cc_b@mail.com

When I see the email header on receiver_cc_a@mail.com. its always show no cc, and that email is send "to" receiver_cc_a@mail.com, not as cc

Is anyone having the same problem? I already try sending email in PHP with PhpMailer and also try from the PHP API from Mandrill itself but no luck.

PravinS
  • 2,640
  • 3
  • 21
  • 25
Nikolius Lau
  • 653
  • 2
  • 11
  • 21

1 Answers1

13

You need to set the option preserve_recipients to true.

$message = array(
    'html' => '<p>Example HTML content</p>',
    'text' => 'Example text content',
    'subject' => 'example subject',
    'from_email' => 'message.from_email@example.com',
    'from_name' => 'Example Name',
    'to' => array(
        array(
            'email' => 'recipient.email@example.com',
            'name' => 'Recipient Name',
            'type' => 'to'
        ),
        array(
            'email' => 'ccrecipient.email@example.com',
            'name' => 'Recipient Name',
            'type' => 'cc'
        )
    ),
    'headers' => array('Reply-To' => 'message.reply@example.com'),
    'preserve_recipients' => true
);
Zied Feki
  • 812
  • 1
  • 10
  • 19