Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mandrill not showing the right Cc information

Tags:

php

mandrill

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

When I see the email header on [email protected]. its always show no cc, and that email is send "to" [email protected], 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.

like image 914
Nikolius Lau Avatar asked Mar 09 '17 09:03

Nikolius Lau


1 Answers

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' => '[email protected]',
    'from_name' => 'Example Name',
    'to' => array(
        array(
            'email' => '[email protected]',
            'name' => 'Recipient Name',
            'type' => 'to'
        ),
        array(
            'email' => '[email protected]',
            'name' => 'Recipient Name',
            'type' => 'cc'
        )
    ),
    'headers' => array('Reply-To' => '[email protected]'),
    'preserve_recipients' => true
);
like image 191
Feki Zied Avatar answered Oct 23 '22 12:10

Feki Zied