从.NET应用程序发送电子邮件的最佳方式? [英] Best way to send an email from a .NET application?

查看:158
本文介绍了从.NET应用程序发送电子邮件的最佳方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个Windows Forms(.NET 3.5)应用程序,该应用程序具有内置的异常处理程序,可以捕获可能发生的任何(天堂禁止)异常。我想要异常处理程序能够提示用户点击发送错误报告按钮,这将导致应用程序发送电子邮件到我的FogBugz电子邮件地址。



最好的方法是什么?有没有什么忧愁要注意?

解决方案

您将按照 这里

没有问题 - 发送电子邮件是一样容易。


I'm working on a Windows Forms (.NET 3.5) application that has a built-in exception handler to catch any (heaven forbid) exceptions that may arrise. I'd like the exception handler to be able to prompt the user to click a "Send Error Report" button, which would then cause the app to send an email to my FogBugz email address.

What's the best way to do this, and are there any "gotchas" to watch out for?

解决方案

You'll want to use the SmtpClient class as outlined here.
There are no gotchas - sending email is about as easy as it gets.

这篇关于从.NET应用程序发送电子邮件的最佳方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆