mailjet 1.0.1+1
mailjet: ^1.0.1+1 copied to clipboard
unofficial Mailjet client
MailJet #
unofficial Mailjet client 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)
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"),
],
)
Contribute/donate by tapping on the Pay Pal logo/image #
Created by #
References #
- https://serverfault.com/questions/371907/can-you-pass-user-pass-for-http-basic-authentication-in-url-parameters
- https://documenter.getpostman.com/view/6592892/S1a4WS95#auth-info-2abd657f-0a3b-4965-8ed5-2bc9d1333489
- https://documenter.getpostman.com/view/6592892/S1a4WS95#auth-info-f5f4e52d-b7f7-45cd-b7d0-eba473bcf68b
- https://app.mailjet.com/auth/get_started/developer
- https://stackoverflow.com/questions/50036393/how-to-convert-an-image-to-base64-image-in-flutter
