我正在尝试使用 C# 在 Sharepoint 中创建一个表单。我不太了解 C#,这就是我的错误发生的地方。我希望将信息通过电子邮件发送到提交时的地址。这是我的 tizagEmailForm.html 的代码...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 2</title>
</head>
<body>
<form method="POST" action="tizagEmail.aspx">
To <input type="text" name="To"/> <br />
From <input type="text" name="From"/> <br />
Subject <input type="text" name="Subject"/> <br />
Body <textarea name="Body" rows="5" cols="20" wrap="physical" >
</textarea>
<input type="submit" />
</form>
</body>
</html>
这是我的 tizagEmail.aspx 的代码...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ Page Language="C#"
'Sends an email
Dim mail
Set mail = Server.CreateObject("CDO.Message")
mail.To = Request.Form("To")
mail.From = Request.Form("From")
mail.Subject = Request.Form("Subject")
mail.TextBody = Request.Form("Body")
mail.Send()
Response.Write("Mail Sent!")
'Destroy the mail object!
Set mail = nothing
%>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta name="WebPartPageExpansion" content="full" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 2</title>
</head>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>
如果有人可以帮助我,我将不胜感激。
健康长寿·繁荣昌盛。