开发者

How do I get the filename of the .msg file when I use specifiedPickupDirectory for my .Net SMTP

开发者 https://www.devze.com 2023-01-31 02:09 出处:网络
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.

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消