【问题标题】:How to add tags to outgoing email in Mandrill ( An email services from Mailchimp)?如何在 Mandrill 中为外发电子邮件添加标签(Mailchimp 的电子邮件服务)?
【发布时间】:2017-01-16 05:13:56
【问题描述】:

我正在使用 mandrill 发送电子邮件,并遵循此处的指南:

https://mandrill.zendesk.com/hc/en-us/articles/205582147-How-to-Send-with-PHPMailer

$mail->Host = 'smtp.mandrillapp.com';                 // Specify main and backup server
$mail->Port = 587;                                    // Set the SMTP port
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = 'MANDRILL_USERNAME';                // SMTP username
$mail->Password = 'MANDRILL_APIKEY';                  // SMTP password
$mail->SMTPSecure = 'tls'; 

...并发送电子邮件

但是,API 中有一个标签选项, 我想添加标签来跟踪电子邮件:

https://mandrillapp.com/api/docs/messages.php.html

'tags' => array('password-resets')

问题是,我可以在不包含 API 文件的情况下添加标签吗?在phpmailer的头部添加标签?

非常感谢您的帮助

【问题讨论】:

    标签: php email header smtp mailchimp


    【解决方案1】:

    我在 PHPMailer 类中使用了这个变体:

    $mail->AddCustomHeader('X-MC-Tags:password,some_other_tag');
    

    【讨论】:

      猜你喜欢
      • 2021-05-31
      • 2015-12-21
      • 2013-10-10
      • 1970-01-01
      • 1970-01-01
      • 2013-08-31
      • 1970-01-01
      • 2017-08-25
      • 2016-07-04
      相关资源
      最近更新 更多