带Firebase Extension触发电子邮件的电子邮件发送到垃圾邮件
我在网页(使用Flutter Web制造)上配置了一个联系表格,以使用Firebase Extension Trigger电子邮件自动发送电子邮件。但是,它们直接进入垃圾邮件文件夹。我一直在阅读有关电子邮件转到垃圾邮件的原因,但我不知道我是否有这些。我认为身份验证(如所说这里)不应该是一个问题,因为来自电子邮件和登录的帐户是相同的。
这是将文档添加到Firebase集合中的代码:
Future<void> _submitForm() async {
final isValid = _key.currentState?.validate();
if (isValid != null && isValid) {
_key.currentState?.save();
String message;
try {
final collection = FirebaseFirestore.instance.collection("mail");
await collection.doc().set({
"timestamp": FieldValue.serverTimestamp(),
"to": ["Name LastName <[email protected]>"],
"message": {
"subject": _subject,
"text": "Name: ${_name}\nEmail: ${_email}"
"\nPhone: ${_phone}\n\n${_message}"
}
});
_key.currentState?.reset();
message = "Your message has been sent successfully. We will get in "
"contact with you.";
} catch (_) {
message = "Your message could not be sent. Please try again later.";
}
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text(message)));
}
}
我该如何解决此问题? 提前致谢。
I have a contact form configured on my webpage (made with Flutter web) to send emails automatically with Firebase extension Trigger Email. However, they go directly to the spam folder. I have been reading about the causes why emails go to spam and I don't know if I have any of those. I think authentication (as said here) should not be a problem since the FROM email and the account logged in are the same.
This is the configuration of the extension:
And this is an example of an email sent:
This is the code to add the document to the firebase collection:
Future<void> _submitForm() async {
final isValid = _key.currentState?.validate();
if (isValid != null && isValid) {
_key.currentState?.save();
String message;
try {
final collection = FirebaseFirestore.instance.collection("mail");
await collection.doc().set({
"timestamp": FieldValue.serverTimestamp(),
"to": ["Name LastName <[email protected]>"],
"message": {
"subject": _subject,
"text": "Name: ${_name}\nEmail: ${_email}"
"\nPhone: ${_phone}\n\n${_message}"
}
});
_key.currentState?.reset();
message = "Your message has been sent successfully. We will get in "
"contact with you.";
} catch (_) {
message = "Your message could not be sent. Please try again later.";
}
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text(message)));
}
}
Any idea how could I fix this?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论