emailjs 1.3.0 copy "emailjs: ^1.3.0" to clipboard
emailjs: ^1.3.0 copied to clipboard

EmailJS helps sending emails directly from the Flutter app. No server is required.

Official EmailJS SDK for Flutter #

SDK for EmailJS.com customers.
Use you EmailJS account for sending emails.

Disclaimer #

This is a flutter-only version, otherwise use

Official SDK Docs

Intro #

EmailJS helps to send emails directly from your code. No large knowledge is required – just connect EmailJS to one of the supported email services, create an email template, and use our SDK to trigger an email.

Usage #

Install EmailJS SDK:

$ flutter pub add emailjs 

Note: By default, API requests are disabled for non-browser applications. You need to activate them through Account:Security.

FAQ #

API calls are disabled for non-browser applications

You need to activate API requests through Account:Security.

Examples #

send email

import package:emailjs/emailjs.dart

Map<String, dynamic> templateParams = {
  'name': 'James',
  'notes': 'Check this out!'
};

try {
  await EmailJS.send(
    '<YOUR_SERVICE_ID>',
    '<YOUR_TEMPLATE_ID>',
    templateParams,
    const Options(
      publicKey: '<YOUR_PUBLIC_KEY>',
      privateKey: '<YOUR_PRIVATE_KEY>',
    ),
  );
  print('SUCCESS!');
} catch (error) {
  print(error.toString());
}

init (optional)

import package:emailjs/emailjs.dart

// set Public Key as global settings
EmailJS.init(const Options(
  publicKey: '<YOUR_PUBLIC_KEY>',
  privateKey: '<YOUR_PRIVATE_KEY>',
));

try {
  // send the email without dynamic variables
  await EmailJS.send(
    '<YOUR_SERVICE_ID>',
    '<YOUR_TEMPLATE_ID>',
  );
  print('SUCCESS!');
} catch (error) {
  print(error.toString());
}
29
likes
140
pub points
89%
popularity

Publisher

verified publisheremailjs.com

EmailJS helps sending emails directly from the Flutter app. No server is required.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, http

More

Packages that depend on emailjs