SMTPClient.Send crashes production application

狂风中的少年 提交于 2019-12-13 02:57:31

问题


I have used the System.Net.Mail.SMTPClient class in virtually every application I have developed. I have never had any issues with it. However, I am encountering an extremely annoying situation in which a call to SMTPClient.Send causes my production application to crash EVEN WITHIN A TRY/CATCH BLOCK, and THE EXE IS DELETED!

WTF. In the development environment there is no problem whatsoever, email is sent without a hitch.

The application is written in C# and created in Visual Studio 2010. I have a setup project which creates the setup.exe file that the app is installed with. Every time that the production app calls STMPClient.Send it crashes without warning and the EXE disappears.

I have verified all smtp settings and, as I said, there is no problem when running in the development environment.

Does anyone have any idea what could be causing this strange behavior?


回答1:


This has been resolved already through a comment, but adding an answer for future references

Check your anti-virus settings, it might not like it and remove the executable without any warnings. If you are deploying this on client's computers, make sure you purchase a Software Publisher's Digital Certificate. But if your app has been "blacklisted" you might need to take further steps, like submitting a whitelist request to the pertinent entity.



来源:https://stackoverflow.com/questions/22702453/smtpclient-send-crashes-production-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!