在 C# WinForms 中发送电子邮件 VS ASP.NET C#

发布于 2024-09-11 11:11:50 字数 396 浏览 10 评论 0原文

我只是想知道是否还有其他人遇到过和我一样的问题。

我正在尝试使用 ASP.NET(VB/C# 我不太关心)从简单的表单发送电子邮件,而我最关心的是使用 ASP.NET 发送电子邮件似乎要困难得多比 WinForms 中的要好!

在WinForms中,我可以编写一些代码在2分钟内发送一封电子邮件。但是在阅读了一个又一个 ASP.NET 教程后,我不知道该怎么做!太奇怪了。

我不明白的一件事是,没有一个示例演示了 mail.Username = ""; 的用法。或 mail.Password = ""; (例如)。他们在连接到服务器时似乎不使用用户名或密码。

如何在 asp.net 中发送电子邮件,就像在 C# WinForms 中一样,或者至少如果不是相同的方式,是否有一种简单的方法?

谢谢

I was just wondering if anybody else has had the same problem as me.

I am trying to send emails from a simple form using ASP.NET (VB/C# I don't really care), and what does my head in severely is the fact that it seems so much harder to send an email using ASP.NET than it is in WinForms!

In WinForms, I can write some code to send an email in 2 minutes. But after reading tutorial after tutorial on ASP.NET I cannot figure out how to do it! It's so weird.

One thing that I don't get is that NONE of the examples demonstrate the use of mail.Username = ""; or mail.Password = ""; (For Example). They don't seem to use usernames or passwords when connecting to the server.

How can I send an email in asp.net just like I do in C# WinForms, or atleast if not the same way, is there a simple way?

Thank you

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文