R
R
Roman Terekhin2015-04-28 04:39:07
PHP
Roman Terekhin, 2015-04-28 04:39:07

Why doesn't Mandrill send Cyrillic?

$args = array(
    'key' => 'KEY',  
    'message' => array(
        "html" => "<p>Hello</p>",
        "text" => null,
        "from_email" => "[email protected]",
        "from_name" => "Akakiy",
        "subject" => "New task",
        "to" => array(array("email" => "[email protected]")),
        "track_opens" => true,
        "track_clicks" => true,
        "auto_text" => true
    )   
);


$curl = curl_init('https://mandrillapp.com/api/1.0/messages/send.json');
curl_setopt($curl, CURLOPT_POST, true);

curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($args));
$response = curl_exec($curl);
curl_close($curl);


var_export($response);

This code will work and send a message to the mail.
But it is only necessary to write a Russian letter somewhere in the letter (using the method of scientific poke), so immediately the api spits, and it spits allegedly on the wrong key.
I think this is somehow connected with curl, maybe I forgot to specify some parameter for it?
Is there anyone who has experienced this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Skakunov, 2015-05-07
@alex4

Make sure your text editor is set to UTF-8 encoding.
Russian letters can be encoded in different ways, right?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question