如何发送带有特殊字符的Mandrill消息?

I am using Mandrill to send mails to our members.
Sending a normal text message works perfect.
But a message with special characters (ä,ë,ï,ö,ü,€,...) will not be attached in Mandrill's 'html' => variable.

Can anyone tell me how to send a message with special characters through Mandrill?

I tried to edit the $message_content variable with str_replace and preg_replace, none worked so far.

When I use ï and € when typing the message content, it works perfect. But I can't seem to change this when the submit button is pressed.

this is my code:

<?
if(isset($_POST['submit']) {
    $subject = $_POST['subject'];
    $from_name = $_POST['from_name'];
    $from_email = $_POST['from_email'];
    $message_content = nl2br($_POST['message_content']);
    $mail_to_members = array();
    $mail_to_members[] = array('email' => 'name@domain.com');
    $mail_to_members[] = array('email' => 'name@domain.com');

    //Get Mandrill API
    require_once './include/src/Mandrill.php'; 
    $mandrill = new Mandrill('API-key');

    //Create mail
    $message = array(
        'subject' => $subject,
        'from_name' => $from_name,
        'from_email' => $from_email,
        'html' => $message_content,
        'to' => $mail_to_members,
    );

    $mandrill->messages->send($message);
}
?>

We had this exact same problem and we solved it using the following:

mb_convert_encoding($message_content, 'UTF-8', 'ASCII');

It converts your content from ASCII to UTF-8.

Try using htmlentities

It will convert all special characters to HTML entities.

For example:

<?php
$string = 'ä - ë - ï - ö - ü - €';
echo htmlentities($string);

Will outout:

&auml; - &euml; - &iuml; - &ouml; - &uuml; - &euro;

Any HTML parser that follow the standard will be able to display them.