【问题标题】:Mandrill not showing the right Cc informationMandrill 未显示正确的抄送信息
【发布时间】:2017-07-30 04:32:10
【问题描述】:

在过去的几个小时里,这个问题真的让我发疯了。为什么使用 Mandrill 发送的电子邮件未显示有关抄送电子邮件地址的正确信息。

例如,我想发送电子邮件到

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

当我在receiver_cc_a@mail.com 上看到电子邮件标题时。它总是显示没有抄送,并且该电子邮件被发送“到”receiver_cc_a@mail.com,而不是抄送

有人遇到同样的问题吗?我已经尝试使用 PhpMailer 在 PHP 中发送电子邮件,还尝试使用 Mandrill 本身的 PHP API,但没有运气。

【问题讨论】:

  • 显示您的代码,以及您用来与 Mandrill 对话的 API 库
  • 我使用官方库 v1.0.55 得到这个
  • 原来,山魈里有一个设置。。我忘了在哪里,但是有一个设置不活跃这个问题
  • 我想你的意思是:Mandrill - 设置 - 发送默认值 - 发送到多个地址时公开收件人列表
  • @Riscie 是的,这就是设置

标签: php mandrill


【解决方案1】:

您需要将选项preserve_recipients 设置为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
);

【讨论】:

  • 我不知道为什么人们不赞成您的回答。这真的很有帮助。 :)
猜你喜欢
  • 1970-01-01
  • 2018-03-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多