Question

Today I sign-up Mandrill account to learn how it's work. This is my PHP code to send a simple email:

<?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);
?>

This script use this Bitbucket repo.

I wonder how to insert Reply-to email address variable in the script. What is the variable name? I'm looking at the docs page but I get stucked.

I'm new to PHP. I really appreciate your helps. Thanks in advance!

Was it helpful?

Solution

Ok. I found it.

$message->headers = array('Reply-To' => 'another@email.com');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top