1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <?php
include "../../mailjet-apiv3-php-simple-master/src/Mailjet/php-mailjet-v3-simple.class.php";
// This calls sends an email to one recipient.
$mj = new Mailjet('cle_publique', 'cle_prive');
$params = array(
"method" => "POST",
"from" => "moi@gmail.com",
"to" => "toi@gmail.com",
"subject" => "Hello World!",
"html" => "<html>Greetings from Mailjet <img src=\"cid:photo1.jpg\"><img src=\"cid:photo2.jpg\"></html>",
);
$result = $mj->sendEmail($params);
if ($mj->_response_code == 200)
echo "success - email sent";
else
echo "error - " . $mj->_response_code; |
Partager