当我为 .Net SMTP 使用指定的PickupDirectory 时,如何获取 .msg 文件的文件名

发布于 2024-10-08 21:24:38 字数 171 浏览 0 评论 0原文

我试图跟踪使用 SmtpClient.Send“发送”后创建的电子邮件。

我通过将 app.config 配置为使用指定的PickupDirectory 将其配置为写入目录。

我想要访问的是所使用的文件的名称,以便我可以定期检查并确保我的邮件服务器已检索并发送它。

有什么建议吗?

I'm trying to keep track of the email created after I "send" it using SmtpClient.Send.

I have it configured to write to a directory by configuring my app.config to use specifiedPickupDirectory.

What I'd like to gain access to is the name of the file that was used, so that I can periodically check and make sure that my mail server has retrieved it and sent it along.

Any suggestions?

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

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

发布评论

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

评论(1

淡写薰衣草的香 2024-10-15 21:24:38

也许尝试首先在临时目录中创建该文件。确保它是目录中的唯一文件。使用 Directory.GetFiles 查找文件名并将其保存到变量中。然后将文件移动到真实目录。

Perhaps try initially creating the file in a temporary directory. Make sure that it is the only file in the directory. Use Directory.GetFiles to find the file name and save it to a variable. Then move the file to the real directory.

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