A library for sending email over SMTP. Heavily inspired by and partially copied from @kaisellgren/mailer.
import 'emailer.dart';
main() {
SmtpOptions options = new SmtpOptions()
..hostName = 'smtp.server.dk'
..port = 25;
SmtpClient smtpClient = new SmtpClient(options);
Email email = new Email(new Address('[email protected]',
'Some From Name'), 'fqdn.somewhere')
..attachments.add(new Attachment.file(new File('afile.stuff')))
..to = [new Address('[email protected]', 'Some To Name')]
..bcc = [new Address('[email protected]', 'Some Bcc Name')]
..cc = [new Address('[email protected]', 'Some Cc Name')]
..subject = 'Subject!'
..partHtml = 'This is <strong>bold</strong>!'
..partText = 'This is bold!';
smtpClient.send(email)
.then((_) => log.info('\o/'))
.catchError((e) => log.info('/o\'));
}