flutter - 颤振错误:未处理的异常:将 RCPT 发送到:<> 后,响应没有以任何开头:[2]
问题描述
这是我用来从 Flutter 应用程序发送电子邮件的代码:
final smtpServer = gmail(username, password);
final message = Message()
..from = Address(username, '$name')
..recipients.add('pareez.salon@example.com')
..ccRecipients.addAll([''])
..bccRecipients.add(Address(''))
..subject = 'Pareez Salon Booking'
..text = '$name //// $phoneNo //// ${widget.emailText}'
..html = "";
try {
final sendReport = await send(message, smtpServer);
print('Message sent: ' + sendReport.toString());
} on MailerException catch (e) {
print('Message not sent.');
for (var p in e.problems) {
print('Problem: ${p.code}: ${p.msg}');
}
}
var connection = PersistentConnection(smtpServer);
await connection.send(message);
await connection.close();
}
解决方案
推荐阅读
- css - 如何将字体文件从 css 文件加载到 Angular 项目中
- programming-languages - 通用 OOP - 使用类构造函数/初始化内存使用实例化接口/协议
- javascript - jQuery:页面加载时隐藏 div 并显示带有过渡的 div
- c# - .net core 2.2 多重认证方案
- sql - Spark 数据帧上的 Pivot 仅在几列之一上返回意外的空值
- kubernetes - 解决此 kubernetes 错误的方法:Ingress“生成的入口”无效:metadata.annotations:太长:最多必须有 262144 个字符
- c++ - 实现一个函数,该函数将字符串作为输入并返回一个没有辅音字母的新字符串替换为“!”
- node.js - Nodejs 服务器在本地主机上工作,但在真实服务器上不工作
- java - 单号 II - 需要通用解决方案
- amazon-ec2 - 是否可以在使用 Terraform 创建期间将 EFS 文件系统挂载到 EC2 实例?