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

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

问题描述

我工作的一个Windows窗体(.NET 3.5)应用程序,它有一个内置的异常处理程序来捕捉任何(但愿),可能arrise例外。我想在异常处理程序能够提示用户点击发送错误报告按钮,然后将导致该应用发送电子邮件到我的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?

推荐答案

您会希望使用SmtpClient类概括的这里
有没有陷阱 - 发送电子邮件是因为它得到一样简单

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天全站免登陆