smtp 1.0.0+1 copy "smtp: ^1.0.0+1" to clipboard
smtp: ^1.0.0+1 copied to clipboard

An SMTP 5321 server implementation in Dart. Use this to receive e-mail messages within the Dart VM.

smtp #

Pub build status

An SMTP 5321 server implementation in Dart.

Usage #

This SMTP server should not be used as your front-facing server, especially in production. Consider setting up Postfix to relay e-mail to this server; that way, you can be sure that only well-formed e-mail messages will touch your Dart code.

Note that this includes no spam protection, etc., and is simply a plain SMTP server library.


main() async {
  var server = await SmtpServer.bind('127.0.0.1', 0);

  await for (var mailObject in server.mailObjects) {
    print(mailObject.envelope.originatorAddress);
    print(mailObject.envelope.headers.cc);
    mailObject.close(statusCode: 221, reasonPhrase: 'Bye!');
  }
}
0
likes
30
pub points
55%
popularity

Publisher

unverified uploader

An SMTP 5321 server implementation in Dart. Use this to receive e-mail messages within the Dart VM.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

async, dart2_constant, http_parser, mime

More

Packages that depend on smtp