We Love Developers

Mailjet routes your newsletters & transactional emails
from our website or any of your tools

Send
Track
Deliver
Get started

API integration

Leveraging the power of Mailjet's API is easy and fast. Mailjet was built entirely using our own API. It's fast, intuitive, RESTful and can be used with any language that supports http(s) requests. Check how simple it is to send an email with only one simple API call!

Use Mailjet API
# This calls sends an email to one recipient.
curl -s \
	-X POST \
	--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
	https://api.mailjet.com/v3/REST/send \
	-H 'Content-Type: application/json' \
	-d '{
		"FromEmail":"pilot@mailjet.com",
		"FromName":"Mailjet Pilot",
		"Subject":"Your email flight plan!",
		"Text-part":"Dear passenger, welcome to Mailjet! May the delivery force be with you!",
		"Html-part":"

Dear passenger, welcome to Mailjet!


May the delivery force be with you!", "Recipients":[ { "Email": "passenger@mailjet.com" } ] }'
use \Mailjet\Resources;
$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));
$body = [
    'FromEmail' => "pilot@mailjet.com",
    'FromName' => "Mailjet Pilot",
    'Subject' => "Your email flight plan!",
    'Text-part' => "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
    'Html-part' => "

Dear passenger, welcome to Mailjet!


May the delivery force be with you!", 'Recipients' => [ [ 'Email' => "passenger@mailjet.com" ] ] ] $response = $mj->post(Resources::$Email, ['body' => $body]); $response->success() && var_dump($response->getData());
/**
 *
 * This calls sends an email to one recipient.
 *
 */
var mailjet = require ('node-mailjet')
	.connect(process.env.MJ_APIKEY_PUBLIC, process.env.MJ_APIKEY_PRIVATE)
var request = mailjet
	.post("send")
	.request({
		"FromEmail":"pilot@mailjet.com",
		"FromName":"Mailjet Pilot",
		"Subject":"Your email flight plan!",
		"Text-part":"Dear passenger, welcome to Mailjet! May the delivery force be with you!",
		"Html-part":"

Dear passenger, welcome to Mailjet!


May the delivery force be with you!", "Recipients":[ { "Email": "passenger@mailjet.com" } ] }); request .on('success', function (response, body) { console.log (response.statusCode, body); }) .on('error', function (err, response) { console.log (response.statusCode, err); });
# This calls sends an email to one recipient.
Mailjet.configure do |config|
  config.api_key = ENV['MJ_APIKEY_PUBLIC']
  config.secret_key = ENV['MJ_APIKEY_PRIVATE']
  config.default_from = 'your default sending address'
end
variable = Mailjet::Send.create(from_email: "pilot@mailjet.com",from_name: "Mailjet Pilot",subject: "Your email flight plan!",text_part: "Dear passenger, welcome to Mailjet! May the delivery force be with you!",html_part: "

Dear passenger, welcome to Mailjet!


May the delivery force be with you!",recipients: [{ 'Email'=> 'passenger@mailjet.com'}])
"""
This calls sends an email to one recipient.
"""
from mailjet import Client
import os
api_key = os.environ['MJ_APIKEY_PUBLIC']
api_secret = os.environ['MJ_APIKEY_PRIVATE']
mailjet = Client(auth=(api_key, api_secret))
data = {
  'FromEmail': 'pilot@mailjet.com',
  'FromName': 'Mailjet Pilot',
  'Subject': 'Your email flight plan!',
  'Text-part': 'Dear passenger, welcome to Mailjet! May the delivery force be with you!',
  'Html-part': '

Dear passenger, welcome to Mailjet!


May the delivery force be with you!', 'Recipients': [ { "Email": "passenger@mailjet.com" } ] } result = mailjet.send.create(data=data)
package MyClass;
import com.mailjet.client.errors.MailjetException;
import com.mailjet.client.errors.MailjetClient;
import com.mailjet.client.errors.MailjetRequest;
import com.mailjet.client.errors.MailjetResponse;
import com.mailjet.client.resource.Email;
public class MyClass {
    /**
     * This calls sends an email to one recipient.
     */
    public static void main(String[] args) throws MailjetException {
      MailjetClient client;
      MailjetRequest request;
      MailjetResponse response;
      client = new MailjetClient("api key", "api secret");
      request = new MailjetRequest(Email.resource)
                        .property(Email.FROMEMAIL, "pilot@mailjet.com")
                        .property(Email.FROMNAME, "Mailjet Pilot")
                        .property(Email.SUBJECT, "Your email flight plan!")
                        .property(Email.TEXTPART, "Dear passenger, welcome to Mailjet! May the delivery force be with you!")
                        .property(Email.HTMLPART, "

Dear passenger, welcome to Mailjet!


May the delivery force be with you!") .property(Email.RECIPIENTS, new JSONArray() .put(new JSONObject() .put("Email", "passenger@mailjet.com"))); response = client.post(request); System.out.println(response.getData()); } }

It works with

+ 25 others applications Mailjet works with Wordpress Mailjet works with Joomla Mailjet works with Zapier Mailjet works with Dotclear Mailjet works with Magento

Code wrappers

What's better than being able to kick-start development without worrying about developing your own libraries? Use one of our official libraries to get started with Mailjet today!

Use Mailjet code wrappers

Need an expert ?

No problem! Anytime you get stuck using Mailjet you can count on us. Whether it’s a technical issue or not, we are here to help you have a great experience!

Contact Mailjet support

Paris

Toronto

Ho Chi Minh

Create your account for FREE!

Start with 6,000 emails/month (200 emails per day) - No contracts / No hidden fees

Create an account with Mailjet
Made with in Paris