我使用的是 mailer 0.8.1 并尝试创建演示应用程序以在 dartlang 中发送邮件,但它不起作用。这是我的代码:
var options = new GmailSmtpOptions()
..username = 'my gmail account'
..password = 'my gmail pass';
var emailTransport = new SmtpTransport(options);
var envelope = new Envelope()
..from = 'testmailer@gmail.com'
..recipients.add('testmailer@gmail.com')
..subject = 'Testing mailer'
..text = 'This is test mailer'
..html = '<h1>Test send mail</p>';
.then((success) => print('Email sent! $success'))
.catchError((e) => print('Error occured: $e'));
但是当我运行应用程序时,它不会打印任何东西。有人可以帮助我吗?谢谢1