mailjet 1.0.3+3 copy "mailjet: ^1.0.3+3" to clipboard
mailjet: ^1.0.3+3 copied to clipboard

unofficial Mailjet client

MailJet #

Unofficial Mailjet client. Meant to provide easy access(interaction) to core mailjet functionality.

Hecho en 🇵🇷 por Radamés J. Valentín Reyes


Import package #

import 'package:mailjet/mailjet.dart';
import 'dart:io';

Get API key #

Step 1 #

Step 2 #

Step 3 #

Step 4 #

Copy the credentials from the last page(step 3)


Get SMS API token #

Step 1 #

Step 1

Step 2 #

Step 2

Step 3 #

Step 3

Step 4 #

Copy the Token value from step 3


Send Email #

How to send a simple HTML email? #

An example sending and email to oneself

String apiKey = "public key provided by mailjet";
String secretKey = "secret key provided by mailjet";
//An email registered to your mailjet account
String myEmail = "email@domain.com";

MailJet mailJet = MailJet(
  apiKey: apiKey,
  secretKey: secretKey,
);
//Display the response after trying to send the email
print(await mailJet.sendEmail(
  subject: "My first Mailjet email", 
  sender: Sender(
    email: myEmail, 
    name: "My name",
  ), 
  reciepients: [
    Recipient(
      email: myEmail, 
      name: "My other name",
    ),
  ], 
  htmlEmail: "<h3>Dear passenger 1, welcome to <a href='https://www.mailjet.com/'>Mailjet</a>!</h3><br />May the delivery force be with you!",
));

HTML email with attachments #

MailJet mailJet = MailJet(
  apiKey: apiKey,
  secretKey: secretKey,
);
await mailJet.sendEmail(
  subject: "My first Mailjet email", 
  sender: Sender(
    email: myEmail, 
    name: "My name",
  ), 
  reciepients: [
    Recipient(
      email: myEmail,
      name: "My other name",
    ),
  ], 
  htmlEmail: "<h3>Dear passenger 1, welcome to <a href='https://www.mailjet.com/'>Mailjet</a>!</h3><br />May the delivery force be with you!",
  Attachments: [
    File("./images/raw_ware.png"),
  ],
)

HTML email with inline attachments #

MailJet mailJet = MailJet(
  apiKey: apiKey,
  secretKey: secretKey,
);
print(await mailJet.sendEmail(
  subject: "My first Mailjet email", 
  sender: Sender(
    email: myEmail, 
    name: "My name",
  ), 
  reciepients: [
    Recipient(
      email: myEmail,
      name: "My other name",
    ),
  ], 
  htmlEmail: "<img src='cid:raw_ware_logo'><br/><h3>Dear passenger 1, welcome to <a href='https://www.mailjet.com/'>Mailjet</a>!</h3><br />May the delivery force be with you!",
  InlinedAttachments: [
    InlinedAttachment(
      file: attachedImage, 
      contentID: "raw_ware_logo",
    ),
  ],
));

Send SMS(untested function(may not work)) #

Sending text messages

MailJet mailJet = MailJet(
  apiKey: apiKey,
  secretKey: secretKey,
);
print(await mailJet.sendSMS(
  smsSecretKey: smsSecretKey,
  from: "Secret", 
  to: "+19394644793", 
  text: "Testing Mailjet SMS services. Package created by Raw Ware Software.",
));

Contribute/donate by tapping on the Pay Pal logo/image #


Created by #


References #

3
likes
100
pub points
72%
popularity

Publisher

unverified uploader

unofficial Mailjet client

Documentation

API reference

License

MIT (LICENSE)

Dependencies

mimalo, sexy_api_client

More

Packages that depend on mailjet