ColdFusion 电子邮件 - 有没有办法确认电子邮件已发送?

发布于 2024-09-03 07:01:06 字数 111 浏览 14 评论 0原文

仅使用标准cfmail标签,有没有办法可以确认电子邮件已发送?

我尝试了 cftry/cfcatch 但这只能确认处理标签时没有错误,如果我放入无效的邮件服务器,它会通过(但邮件显然不会发送)

Just using the standard cfmail tag, is there a way we can confirm that the email has been sent?

I tried cftry/cfcatch but that only confirms that there were no errors in processing the tag, if I put in an invalid mail server, it passes (but mail obviously doesnt send)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

清音悠歌 2024-09-10 07:01:06

如果无法访问日志,一种黑客方法是密件抄送备用地址。

One hackish way, if do not have access to the logs, is to bcc an alternate address.

舂唻埖巳落 2024-09-10 07:01:06

如果它不在假脱机文件夹中,并且不在错误日志中,则它已被发送。

请参阅:将 ColdFusion 与邮件服务器结合使用

If it is not in the spool folder, and not in the error log, it has been sent.

see: Using ColdFusion with mail servers

莫相离 2024-09-10 07:01:06

您始终可以编写一个例程来检查邮件日志。这要求您有权访问日志文件。

You can always write a routine to check the mail log. That requires you to have access to the log files.

可可 2024-09-10 07:01:06

如果您关闭将消息假脱机到磁盘,它们将尝试立即发送。然后您可以使用 try/catch 进行捕获,这应该可以让您记录任何 SMTP 错误。如果您没有收到错误,那么您可以确信消息已成功发送。

这可能会对负载下的性能产生负面影响。它还会对用户体验产生负面影响,因为用户将等待通常在后台进行的 SMTP 协商。然后您可能会考虑使用 CFTHREAD,但为什么不直接使用本机假脱机呢?

If you turn off spooling the messages to disk, they'll attempt to be sent immediately. Then you can trap with try/catch which should let you log any SMTP errors. If you don't get an error then you are reasonably assured that the message was sent successfully.

This may have negative ramifications for performance under load. It will also negatively impact the user experience as the user will be waiting for the SMTP negotiation that usually takes place in the background. You might then consider using CFTHREAD, but then why not just use the native spooling?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文