📄 send.aspx
字号:
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Web.Mail" %>
<html>
<head>
<title>Send image</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body bgcolor="#C0C0CA">
<%
NameValueCollection fields = Request.Form;
if (fields.Count > 0) {
MailMessage myMail = new MailMessage();
string filePath = Server.MapPath("./");
myMail.Attachments.Add(new MailAttachment(filePath + "\\" + fields.Get("filename")));
myMail.From = fields.Get("from");
myMail.To = fields.Get("to");
myMail.Subject = fields.Get("subject");
myMail.Body = fields.Get("message");
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(myMail);
Response.Write ("<p>Image and message are sent successfully</p>");
Response.Write ("<p><a href='edit.htm'>Go back to editing</a></p>");
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -