[英]Change IIS Express to full functions IIS when debug in Visual Studio 2012
In ASP.NET Unleashed book (SAMS Publishing, http://www.informit.com/store/asp.net-4-unleashed-9780672331121 ISBN-10: 0-13-256581-1 ) have a snippet: File: SendMail.aspx : 在ASP.NET Unleashed书(SAMS Publishing, http : //www.informit.com/store/asp.net-4-unleashed-9780672331121 ISBN-10:0-13-256581-1)中有一个代码段:File: SendMail .aspx :
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Net.Mail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void Page_Load()
{
SmtpClient client = new SmtpClient();
client.Host = "localhost";
client.Port = 25;
client.Send("nate@somewhere", "nate@exclaimcomputing.com",
"Beware!", "Watch out for zombies!");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Send Mail</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Email sent!
</div>
</form>
</body>
</html>
The book warning: "...sends the email by using the local SMTP Server. If your SMTP Server is not enabled, you receive the error An Existing Connection Was Forcibly Closed by the Remote Host. You can enable your local SMTP Server by opening Internet Information Services, right-clicking Default SMTP Virtual Server, and selecting Start." 本书警告: “ ...通过使用本地SMTP服务器发送电子邮件。如果未启用SMTP服务器,则会收到错误消息:远程主机强行关闭了现有连接。您可以通过以下方式启用本地SMTP服务器: Internet信息服务,用鼠标右键单击默认SMTP虚拟服务器,然后选择开始。”
By using Visual Sutio 2012, include built-in IIS Express, I can not practice this code, because IIS Express don't support SMTP. 通过使用Visual Sutio 2012(包括内置IIS Express),我无法练习此代码,因为IIS Express不支持SMTP。
Please help me change IIS Express to full function IIS to practice below snippet. 请帮助我将IIS Express更改为全功能IIS,以在以下代码片段中进行练习。
IIS Express is a version on Home/Family editions, not professional/Ultimate. IIS Express是家庭/家庭版的版本,不是专业/最终版。 If you don't have a Windows Pro/Ultimate you can install your own SMTP server, there are plenty of free good ones on the Web.
如果没有Windows Pro / Ultimate,则可以安装自己的SMTP服务器,网络上有很多免费的优质服务器。
But if you don't want to lost time to instal/configure an SMTP server for testing emails you can directly send emails from the .Net Framework. 但是,如果您不想浪费时间安装/配置SMTP服务器来测试电子邮件,则可以直接从.Net Framework发送电子邮件。
OK. 好。 So you installed IIS after .Net, so make sure that you've run aspnet_regiis.exe .
因此,您在 .Net 之后安装了IIS,因此请确保已运行aspnet_regiis.exe 。
Now, right click your project, choose properties and follow these instructions from Microsoft. 现在,右键单击您的项目,选择属性,然后按照Microsoft的说明进行操作 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.