Search packages, repositories and app categories

GitHub repositoryemailjs-com/emailjs-flutter

emailjs-flutter

Official EmailJS SDK for Flutter

emailjs-flutter project cover
Stars
2
Forks
0
Last push (UTC)
Jun 15, 2024
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

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

Links

Official SDK Docs

Intro

EmailJS helps to send emails directly from your code. No server 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 as emailjs

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

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

init (optional)

import package:emailjs/emailjs.dart as emailjs

// set Public Key as global settings
emailjs.init(const emailjs.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');
}
EmailJS GitHub avatar
GitHub author

EmailJS ↗

The easiest way to send emails directly from your code

LanguagesDart

Packages published by this repository

Dependencies used

Dependency list 6 items

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗