Mandrill回复

Zul*_*din 4 php mandrill

今天我注册了Mandrill帐户,了解它是如何工作的.这是我发送简单邮件的PHP代码:

<?php

$apikey = 'API_KEY_HERE';

require_once 'Mandrill.php';
$mandrill = new Mandrill($apikey);

$message = new stdClass();
$message->html = "html message";
//$message->text = "text body";
$message->subject = "email subject";
$message->from_email = "from@email.com";
$message->from_name  = "My App Name";
$message->to = array(array("email" => "recipient@email.com"));
$message->track_opens = true;

$response = $mandrill->messages->send($message);

var_dump($response);
?>
Run Code Online (Sandbox Code Playgroud)

这个脚本使用这个Bitbucket repo.

我想知道如何在脚本中插入回复电子邮件地址变量.什么是变量名称?我正在查看文档页面但是我被卡住了.

我是PHP的新手.我非常感谢你的帮助.提前致谢!

Zul*_*din 14

好.我找到了.

$message->headers = array('Reply-To' => 'another@email.com');
Run Code Online (Sandbox Code Playgroud)