在 C# WinForms 中发送电子邮件 VS ASP.NET C#
我只是想知道是否还有其他人遇到过和我一样的问题。
我正在尝试使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用用户名/密码:
http://www.aspnettutorials.com /tutorials/email/email-auth-aspnet2-csharp.aspx
Using username/password:
http://www.aspnettutorials.com/tutorials/email/email-auth-aspnet2-csharp.aspx