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 = "[email protected]";
$message->from_name = "My App Name";
$message->to = array(array("email" => "[email protected]"));
$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!
Ok. I found it.
$message->headers = array('Reply-To' => '[email protected]');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With