Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9183993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:56:16+00:00 2026-06-17T18:56:16+00:00

What is the easiest way to send an email via Mailchimp’s Mandrill service (using

  • 0

What is the easiest way to send an email via Mailchimp’s Mandrill service (using the API).

Here’s the send method: https://mandrillapp.com/api/docs/messages.html#method=send

Here’s the API wrapper: https://bitbucket.org/mailchimp/mandrill-api-php/src/fe07e22a703314a51f1ab0804018ed32286a9504/src?at=master

But I can’t figure out how to make an PHP function that will send and email via Mandrill.

Can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:56:17+00:00Added an answer on June 17, 2026 at 6:56 pm

    We also have an official API wrapper for PHP, which is available on Bitbucket or via Packagist, which wraps the Mandrill API for you.

    If your Mandrill API key is stored as an environment variable, here’s a simple example of sending using a template, with some merge variables and metadata:

    <?php
    require 'Mandrill.php';
    
    $mandrill = new Mandrill();
    
    // If are not using environment variables to specific your API key, use:
    // $mandrill = new Mandrill("YOUR_API_KEY")
    
    $message = array(
        'subject' => 'Test message',
        'from_email' => 'you@yourdomain.example',
        'html' => '<p>this is a test message with Mandrill\'s PHP wrapper!.</p>',
        'to' => array(array('email' => 'recipient1@domain.example', 'name' => 'Recipient 1')),
        'merge_vars' => array(array(
            'rcpt' => 'recipient1@domain.example',
            'vars' =>
            array(
                array(
                    'name' => 'FIRSTNAME',
                    'content' => 'Recipient 1 first name'),
                array(
                    'name' => 'LASTNAME',
                    'content' => 'Last name')
        ))));
    
    $template_name = 'Stationary';
    
    $template_content = array(
        array(
            'name' => 'main',
            'content' => 'Hi *|FIRSTNAME|* *|LASTNAME|*, thanks for signing up.'),
        array(
            'name' => 'footer',
            'content' => 'Copyright 2012.')
    
    );
    
    print_r($mandrill->messages->sendTemplate($template_name, $template_content, $message));
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What's the easiest way to search a div for a text string using jquery?
Since I need to send email by code, I'm currently using plan text but
The easiest way I see to explain what I need is via example. Suppose
What is the easiest way to send and receive mails in java.
I'm using delayed job (https://github.com/collectiveidea/delayed_job) to send emails upon user signup. I want to
I know the easiest way is using a regular expression , but I wonder
I'm using mailman gem for fetching email from pop3 server and send it to
What is the best and easiest way to send a string from one instance
What would be the easiest way to be able to send and receive raw
The easiest way to explain my question may be with an example, so let

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.