mailer 1.1.4

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 95

Mailer

Mailer is an easy to use library for composing and sending emails in Dart.

Mailer supports file attachments, HTML emails and multiple transport methods.

Features

  • Plaintext and HTML emails
  • Unicode support
  • Attachments
  • Secure (filters and sanitizes all fields context-wise)
  • Use any SMTP server like Gmail, Live, SendGrid, Amazon SES
  • SSL/TLS support
  • Pre-configured services (Gmail, Live, Mail.ru, etc.). Just fill in your username and password.

Filing bug tickets

Please call printDebugInformation() from the mailer package and send the output along with your helpful explanation of what went wrong.

TODO

  • All possible SMTP authentication methods (now just LOGIN)
  • Sendmail
  • Stream attachments
  • String-based attachments

Examples

Sending an email with SMTP

In this example we send an email using a Gmail account.

import 'package:mailer/mailer.dart';

main() {
  // If you want to use an arbitrary SMTP server, go with `new SmtpOptions()`.
  // This class below is just for convenience. There are more similar classes available.
  var options = new GmailSmtpOptions()
    ..username = 'your gmail username'
    ..password = 'your gmail password'; // Note: if you have Google's "app specific passwords" enabled,
                                        // you need to use one of those here.
                                        
  // How you use and store passwords is up to you. Beware of storing passwords in plain.

  // Create our email transport.
  var emailTransport = new SmtpTransport(options);

  // Create our mail/envelope.
  var envelope = new Envelope()
    ..from = 'foo@bar.com'
    ..recipients.add('someone@somewhere.com')
    ..bccRecipients.add('hidden@recipient.com')
    ..subject = 'Testing the Dart Mailer library 語'
    ..attachments.add(new Attachment(file: new File('path/to/file')))
    ..text = 'This is a cool email message. Whats up? 語'
    ..html = '<h1>Test</h1><p>Hey!</p>';

  // Email it.
  emailTransport.send(envelope)
    .then((envelope) => print('Email sent!'))
    .catchError((e) => print('Error occurred: $e'));
}

License

This library is licensed under MIT.

1.1.4

  • Remove extra trailing \r\n from messages as some servers may interpret it as an empty command and send back an error code after success code

1.1.3

  • Fix occasional issue with completer already completed. Due to an error with SMTP server closing connection after sending the email.

1.1.2

  • Fix new lines sent to server to be proper \r\n format

1.1.1

  • loosen crypto dependency to '>=0.9.0 <3.0.0' as suggested in the crypto changelog

1.1.0

  • merge crypto util fix and update example
  • upgrade unittest to test and move it to dev_dependencies
  • added OpenMailBoxSmtpOptions
  • improve address parsing and sanitization (from hoylen)
  • cleanup chunkEncodedBytes and associated test
  • update example to allow CC and BCC

1.0.1

  • add simple example/send_gmail.data
  • fix pubspec to pull crypto 0.9.0

1.0.0 - Oct 4, 2015

  • initial release

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  mailer: "^1.1.4"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:mailer/mailer.dart';
        
Version Uploaded Documentation Archive
1.1.4 May 26, 2017 Go to the documentation of mailer 1.1.4 Download mailer 1.1.4 archive
1.1.3 May 24, 2017 Go to the documentation of mailer 1.1.3 Download mailer 1.1.3 archive
1.1.2 May 23, 2017 Go to the documentation of mailer 1.1.2 Download mailer 1.1.2 archive
1.1.1 Sep 11, 2016 Go to the documentation of mailer 1.1.1 Download mailer 1.1.1 archive
1.1.0 Aug 16, 2016 Go to the documentation of mailer 1.1.0 Download mailer 1.1.0 archive
1.0.1 Jul 28, 2016 Go to the documentation of mailer 1.0.1 Download mailer 1.0.1 archive
1.0.0 Oct 4, 2015 Go to the documentation of mailer 1.0.0 Download mailer 1.0.0 archive
0.8.12 Sep 22, 2014 Go to the documentation of mailer 0.8.12 Download mailer 0.8.12 archive
0.8.11 Dec 16, 2013 Go to the documentation of mailer 0.8.11 Download mailer 0.8.11 archive
0.8.10 Nov 11, 2013 Go to the documentation of mailer 0.8.10 Download mailer 0.8.10 archive

All 18 versions...

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Dec 6, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
90
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall score:
Weighted score of the above. [more]
95

Platforms

Detected platforms: Flutter, server

all of the above

Dependencies

Package Constraint Resolved Available
Direct dependencies
crypto >=0.9.0 <3.0.0 2.0.2+1
intl >=0.9.0 <2.0.0 0.15.2
logging >=0.9.0 <2.0.0 0.11.3+1
mime >=0.9.0 <2.0.0 0.9.4
path >=0.9.0 <2.0.0 1.5.1
Transitive dependencies
charcode 1.1.1
collection 1.14.3
convert 2.0.1
typed_data 1.1.5
Dev dependencies
args ^0.13.5
test ^0.12.4