本文介绍了Umbraco联系表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

以下联系表格适用于vs 2010,通常用于创建应用程序.除了应用程序源代码:

Hey All,

Following contact form works in vs 2010, typically create application. In addition to application source code:

Name:
<asp:TextBox ID="txtName" runat="server" />
Email:
<asp:TextBox ID="txtEmail" runat="server" />

Message:
<asp:TextBox ID="txtContent" runat="server" TextMode="MultiLine" />

<asp:Button ID="btnSubmit" runat="server" Text="Send Email" 

onclick="btnSubmit_Click" />


和背后的代码:

DDL:


and Code Behind:

DDL:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Net.Mail;


protected void btnSubmit_Click(object sender, EventArgs e)
{
MailMessage message = new MailMessage();
message.To.Add("[email protected]");
message.Subject = txtName.Text + " sent you a message via contact form";
message.From = new MailAddress(txtEmail.Text);
message.Body = txtContent.Text;
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.Credentials = new NetworkCredential("[email protected]", "yourpassword");
client.EnableSsl = true;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(message);
client.EnableSsl = true;
}


问题是,为什么在Umbraco CMS中不起作用?

谢谢
Jovan


The question is, Why does not work in Umbraco CMS?

Thank you,
Jovan

推荐答案



这篇关于Umbraco联系表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 17:23