Integrations

Official SDKs and libraries to integrate Mailngine into your application. Get from zero to sending in minutes.

Go

Install

bash
go get github.com/mailngine/mailngine-go

Send an email

go
package main

import (
  class="hm-code--string">"context"
  mailngine class="hm-code--string">"github.com/mailngine/mailngine-go"
)

func main() {
  client := mailngine.NewClient(class="hm-code--string">"mn_live_xxxxx")

  _, err := client.Emails.Send(context.Background(), &mailngine.SendEmailParams{
    From:    class="hm-code--string">"[email protected]",
    To:      []string{class="hm-code--string">"[email protected]"},
    Subject: class="hm-code--string">"Welcome!",
    HTML:    class="hm-code--string">"<h1>Hello from Go</h1>",
  })
  if err != nil {
    panic(err)
  }
}

Node.js

Install

bash
npm install mailngine

Send an email

typescript
import { Mailngine } from class="hm-code--string">'mailngine';

const client = new Mailngine(class="hm-code--string">'mn_live_xxxxx');

await client.emails.send({
  from: class="hm-code--string">'[email protected]',
  to: [class="hm-code--string">'[email protected]'],
  subject: class="hm-code--string">'Welcome!',
  html: class="hm-code--string">'<h1>Hello from Node.js</h1>',
});

Laravel

Install

bash
composer require mailngine/mailngine-laravel

Send an email

php
class=class="hm-code--string">"hm-code--comment">// config/mail.php — add to class="hm-code--string">'mailers' array:
class="hm-code--string">'mailngine' => [
    class="hm-code--string">'transport' => class="hm-code--string">'mailngine',
],

class=class="hm-code--string">"hm-code--comment">// .env
MAIL_MAILER=mailngine
MAILNGINE_API_KEY=mn_live_xxxxx

class=class="hm-code--string">"hm-code--comment">// Usage — standard Laravel Mail
Mail::to(class="hm-code--string">'[email protected]')
    ->send(new WelcomeEmail());

More SDKs Coming Soon

We are actively working on official SDKs for more languages. Want to help? Contributions are welcome on GitHub.

PythonComing Soon
RubyComing Soon
JavaComing Soon