发送邮件及截图,后台查看

效果图:

前台发送 -

后台查看 -

发送页面代码:

  1 <%@ Page Title="" Language="C#" MasterPageFile="~/UserMainPage.master" AutoEventWireup="true" CodeFile="User_LiuYppp.aspx.cs" Inherits="mbc_Message_User_LiuYppp" %>
  2
  3 <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  4 </asp:Content>
  5 <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  6 <style type="text/css">
  7     body, html, div, blockquote, img, label, p, h1, h2, h3, h4, h5, h6, pre, ul, ol,
  8     li, dl, dt, dd, form, a, fieldset, input, th, td{ margin: 0; padding: 0; border: 0; outline: none; font-weight:normal}
  9     body{line-height: 1.1; font-size:14px; font-family:"微软雅黑"; background-color:#26384a;}
 10     body,html{height: 100%;}
 11     input,select{font-family:"微软雅黑";}
 12     *{box-sizing:border-box}
 13     h1, h2, h3, h4, h5, h6{font-size: 100%;}
 14     ul, ol{list-style: none;}
 15     a{color: #333;text-decoration: none;}
 16     em,i{font-style: normal;}
 17
 18     .messageBox{width: 580px;background: #ffffff;position: absolute;left: 50%;margin-left: -290px;top: 30px;}
 19     .messageBox .msgTitle{height: 68px;font-size: 24px;text-align: center;line-height: 66px;border-bottom: 2px solid #f1f1f1;}
 20     .messageBox .msgTitle i{display: inline-block;width: 37px;height: 32px;background: url(‘images/messgeIcon.png‘) 0 0 no-repeat;vertical-align: middle;margin-top: -3px;margin-right: 5px;}
 21     .messageBox .d1{width: 95%;background: #f0f0f0;color: #121212;margin: 0 auto;margin: 10px auto;padding: 10px;line-height: 24px;}
 22     .messageBox > ul{width: 95%;margin: 0 auto;}
 23     .messageBox > ul li{margin-top: 25px;}
 24     .messageBox > ul li h4{color: #333;margin-bottom: 10px;}
 25     .messageBox > ul li select{width: 100%;height: 40px;padding: 0 5px;color: #333;}
 26     .messageBox > ul li .sctCont{padding: 10px;line-height: 24px;background: #086175;color: #fff;}
 27     .messageBox > ul li textarea{border: 1px solid #b3b3b3;color: #333;width: 100%;height: 100px;line-height: 18px;padding: 5px;}
 28     .messageBox > ul li .uploadBtn{width: 120px;height: 35px;position: relative;text-align: center;display: inline-block;line-height: 35px;background: #086175;color: #fff;}
 29     .messageBox > ul li .uploadBtn:hover{background: #045668;}
 30     .messageBox > ul li .uploadBtn input{position: absolute;left: 0;top: 0;width: 100%;height: 100%;opacity: 0;filter:alpha(opacity=0);}
 31     .messageBox .msgBtn{height: 60px;background: #f0f0f0;text-align: right;padding: 0 20px;margin-top: 20px;}
 32     .messageBox .msgBtn a{display: inline-block;padding: 0 25px;color: #fff;border-radius: 5px;margin-left: 15px;height: 35px;line-height: 35px;margin-top: 13px;}
 33     .messageBox .msgBtn a.cancelBtn{background: #b3b3b3;}
 34     .messageBox .msgBtn a.cancelBtn:hover{background: #a2a2a2;}
 35     .messageBox .msgBtn a.submitBtn{background: #086175;}
 36     .messageBox .msgBtn a.submitBtn:hover{background: #045668;}
 37
 38     @media screen and (max-width: 750px){
 39         .messageBox{width: 90%;left: 5%;margin-left: 0;font-size: 12px;}
 40         .messageBox .msgTitle{font-size: 18px;}
 41         .messageBox .msgTitle i{width: 27px;height: 24px;background-size: 27px 24px;}
 42     }
 43 </style>
 44 <script type="text/javascript">
 45     function CheckContent() {
 46         var biaoti = document.getElementById("<%=txtTitle.ClientID %>").value;
 47         var lycount = document.getElementById("<%=txtContent.ClientID %>").value;
 48         var jsbh = document.getElementById("<%=txtJSAccount.ClientID %>").value;
 49         if (biaoti == "") {
 50             alert("主题不能为空!");
 51             return false;
 52         }
 53         if (jsbh == "") {
 54             alert("接受编号不能为空!");
 55             return false;
 56         }
 57         if (lycount == "") {
 58             alert("具体内容不能为空!");
 59             return false;
 60         } else {
 61             return true;
 62         }
 63     }
 64 </script>
 65
 66 <body class="page-header-fixed ">
 67     <form id="form1" runat="server">
 68         <div class="page-container">
 69             <div class="page-content">
 70                 <div class="container-fluid">
 71                     <div class="row-fluid">
 72                         <div class="span12">
 73                             <h3 class="page-title"> 打款信息<small></small></h3>
 74                             <ul class="breadcrumb">
 75                                 <li><i class="icon-home"></i> <a href="../../mbc/B/UserMain.aspx">首页</a> <i class="icon-angle-right"></i></li>
 76                                 <li><a href="#">发送打款信息</a></li>
 77                             </ul>
 78                         </div>
 79                     </div>
 80                     <div class="row-fluid">
 81                         <div class="span12">
 82                             <div class="portlet-body">
 83                                 <a href="#myModal1" role="button" class="btn btn-primary red" data-toggle="modal"><i class="icon-bullhorn"></i> 给公司发送打款信息</a><br/><br/><br/>
 84                                 <div class="row-fluid">
 85                                     <div class="span12">
 86                                         <div class="portlet box grey">
 87                                             <div class="portlet-title">
 88                                                 <div class="caption"><i class="icon-list"></i> 在线消息</div>
 89                                             </div>
 90                                             <div class="portlet-body  flip-scroll">
 91                                                 <div class="messageFeedbackCont">
 92                                                     <div class="problem">
 93                                                         <asp:Repeater ID="Repeater1" runat="server">
 94                                                             <ItemTemplate>
 95                                                                 <h3><font color="blue" size="4"><b>信息:</b></font><span><%# DataBinder.Eval(Container.DataItem, "liuyan_memo")%></span></h3>
 96                                                             </ItemTemplate>
 97                                                         </asp:Repeater>
 98                                                     </div>
 99                                                     <div class="answer">
100                                                         <asp:Repeater runat="server" ID="Repeater2">
101                                                             <ItemTemplate>
102                                                                 <h3><font color="red" size="4"><b>管理员回复:</b></font><span><%# DataBinder.Eval(Container.DataItem, "liuyan_memo")%></span></h3>
103                                                             </ItemTemplate>
104                                                         </asp:Repeater>
105                                                     </div>
106                                                 </div>
107                                             </div>
108                                         </div>
109                                     </div>
110                                 </div>
111                                 <div id="myModal1" style="position:relative;display: none;border:none;margin-top: -30%;" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
112                                     <div target="iframe_feedback" enctype="multipart/form-data" class="jump-model">
113                                         <div class="messageBox">
114                                             <div class="msgTitle">
115                                                 <i></i>给系统管理员/会员发送
116                                             </div>
117                                             <ul>
118                                                 <li>
119                                                     <h4>主题:</h4>
120                                                     <asp:TextBox ID="txtTitle" runat="server" class="span12 m-wrap"></asp:TextBox>
121                                                 </li>
122                                                 <li>
123                                                     <h4>接收编号:</h4>
124                                                     <asp:TextBox ID="txtJSAccount" runat="server" class="span12 m-wrap" Text="管理员" ReadOnly="True"></asp:TextBox>
125                                                 </li>
126                                                 <li>
127                                                     <h4>具体内容:</h4>
128                                                    <asp:TextBox id="txtContent" TextMode="MultiLine" runat="server" style="width:100%;height: 100px;" class="textinput"></asp:TextBox>
129                                                 </li>
130                                                 <li>
131                                                     <h4>上传截图:</h4>
132                                                     <asp:FileUpload ID="FileUpload1" runat="server" />
133                                                 </li>
134                                             </ul>
135                                             <div class="msgBtn">
136                                                 <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
137                                                 <asp:Button ID="Button1" runat="server" Text="确定提交" style="background:#086175" class="btn blue" OnClientClick="return CheckContent();" OnClick="Button1_OnClick"/>
138                                             </div>
139                                         </div>
140                                     </div>
141                                 </div>
142                             </div>
143                         </div>
144                     </div>
145                 </div>
146             </div>
147         </div>
148         <script type="text/javascript">
149             jQuery(document).ready(function ($) {
150                 var mdid, pdid, gdid, amount, status;
151
152                 $(‘[data-toggle="tooltip"]‘).tooltip({
153                     container: ‘body‘,
154                 });
155
156                 $(‘.hireTable‘).click(function () {
157                     $(‘.‘ + $(this).attr(‘value‘) + ‘.donate-body-‘ + $(this).attr(‘rel‘)).slideToggle(‘normal‘);
158                 });
159
160                 $(‘.transactionWrap‘).hide();
161                 $(‘.btn-details‘).click(function () {
162                     $(this).parents(‘.table-donations‘).siblings(‘.transactionWrap‘).stop(true, false).slideUp(‘normal‘);
163                     $(this).parents(‘.table-donations‘).next().stop(true, false).slideToggle(‘normal‘);
164                     return false;
165                 });
166             });
167         </script>
168     </form>
169 </body>
170 </asp:Content>

后台:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using zx.BusinessLayer;
using zx.DataSqlLayer;

public partial class mbc_Message_User_LiuYppp : System.Web.UI.Page
{
    Database db = new Database();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["huiyuan_id"] == null || Session["huiyuan_bianhao"] == null)
            {
                Response.Redirect("../Error.aspx");  //如果session值为空跳转到错误页面
            }
            else
            {
                Bind();
                BindHF();
            }
        }
    }
    public int count1 = 0;
    public int pdnum = 0;
    private void Bind()
    {
        if (Session["huiyuan_id"] == null || Session["huiyuan_bianhao"] == null)
        {
            Response.Redirect("~/mbc/Error.aspx");
        }
        else
        {string search_sql = " liuyan_bianhao = ‘" + Session["huiyuan_bianhao"].ToString().Trim() + "‘";
            string sqlliu = "select * from tbl_liuyan9 where " + search_sql + "";
            DataSet ds = db.GetDataSet(sqlliu);
            this.Repeater1.DataSource = ds;
            this.Repeater1.DataBind();
        }
    }

    private void BindHF()
    {
        if (Session["huiyuan_id"] == null || Session["huiyuan_bianhao"] == null)
        {
            Response.Redirect("~/mbc/Error.aspx");
        }
        else
        {
            string search_sql = " liuyan_to_bianhao = ‘" + Session["huiyuan_bianhao"].ToString().Trim() + "‘";
            string sqlliu = "select * from tbl_liuyan9 where " + search_sql + "";
            DataSet ds = db.GetDataSet(sqlliu);
            this.Repeater2.DataSource = ds;
            this.Repeater2.DataBind();
        }
    }
    public static bool FUPic(string filename)
    {
        bool ReturnValue = true;
        string IsPic = System.IO.Path.GetExtension(filename).ToLower();
        if (IsPic == ".gif" || IsPic == ".jpg" || IsPic == ".bmp" || IsPic == ".png")
            ReturnValue = true;
        else
            ReturnValue = false;
        return ReturnValue;
    }
    protected void Button1_OnClick(object sender, EventArgs e)
    {
        string jsbianhao = string.Empty;
        string bh = txtJSAccount.Text.Trim();
        string title = txtTitle.Text.Trim();
        string useraccount = txtJSAccount.Text.Trim();
        string content = txtContent.Text.Trim();
        string str = string.Empty;
        if (FileUpload1.FileName != null && FileUpload1.FileName != "")
        {
            if (FUPic(FileUpload1.FileName))
            {
                string datetime = System.DateTime.Now.ToString("yyyyMMddHHmmss");
                string filename = datetime + FileUpload1.FileName;
                string savePath = System.Web.HttpContext.Current.Server.MapPath(("~/manager/images/") + filename);
                FileUpload1.SaveAs(savePath);
                str = "~/manager/images/" + filename;
            }
            else
            {
                Response.Write("<script language=javascript>alert(‘请选择正确图片格式(jpg/bmp/gif/png)!‘);history.go(-1);</script>");
                return;
            }
        }
      //  string sql_tupian = "update tbl_product set logo=‘" + str + "‘ ";
        //db.ExecuteSQL(sql_tupian);
        if (bh == "管理员")
        {
            jsbianhao = "admin";
            string sqlly = "insert into tbl_liuyan9 (liuyan_title,liuyan_bianhao,liuyan_to_bianhao,liuyan_memo,liuyan_date,img)" +
                "values(‘" + title + "‘,‘" + Session["huiyuan_bianhao"].ToString().Trim() + "‘,‘" + jsbianhao.Trim() + "‘,‘" + content + "‘,‘" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") +"‘,‘" + str +  "‘)";
            int ly = db.ExecuteSQL(sqlly);
            if (ly == 1)
            {
                Response.Write("<script >alert(‘留言成功!‘);location.href=‘User_LiuYppp.aspx‘</script>");
                return;
            }
        }

    }
}

查看页面代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="viewnews.aspx.cs" Inherits="huiyuan_mail_viewnews" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/style.css">
    <style type="text/css">
        .style1
        {
            width: 21%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="stripe tab2">
        <tr>
            <th class="style1">
                <div class="tab2_num">
                    留言查看</div>
            </th>
            <th width="55%">
            </th>
            <th width="22%">
            </th>
        </tr>
        <tr>
            <td class="style1" colspan="3">
                <div class="tab2_num">
                ■&nbsp;<asp:Label ID="lbl_title" runat="server"></asp:Label>
                    [<asp:Label ID="lbl_date" runat="server"></asp:Label>
                    ]&nbsp;&nbsp;来自&nbsp;&nbsp;<asp:Label ID="lbl_bianhao" runat="server"></asp:Label>
                    :<asp:Label ID="lbl_name" runat="server"></asp:Label>
                    </div>
            </td>
        </tr>
         <tr>
            <td class="style1">
                <div class="tab2_num">
                    </div>
            </td>
            <td colspan="2">
                <div class="tab2_num2">
                    <asp:Label ID="lbl_text" runat="server"></asp:Label></div>
            </td>

        </tr>

         <tr>
            <td class="style1">
                <div class="tab2_num">
                    </div>
            </td>
            <td colspan="2">
               <div class="tab2_num2">
                 <asp:Image ID="Image1" runat="server" ImageUrl=‘<%# Eval("pro_img") %>‘ AlternateText="image lost" />
           </div>
                    </td>

        </tr>
    </table>
    </form>
</body>
</html>

后台:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using zx.DataSqlLayer;
using System.Data;

public partial class huiyuan_mail_viewnews : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["admin_bianhao"] == null)
        {
            Response.Redirect("/Error.html");

        }
        if (!IsPostBack)
        {
            string id = Request.QueryString["id"].ToString();
            Database db = new Database();
            string sql = "select * from view_liuyan9 where id=‘" + id + "‘";
            DataRow result = db.GetDataRow(sql);
            lbl_title.Text = result["liuyan_title"].ToString();
            lbl_date.Text = result["liuyan_date"].ToString();
            lbl_bianhao.Text = result["liuyan_bianhao"].ToString();
            lbl_name.Text = result["huiyuan_name"].ToString();
            lbl_text.Text = result["liuyan_memo"].ToString();
            Image1.ImageUrl = result["img"].ToString().Trim();
            //db.ExecuteSQL("update tbl_liuyan set liuyan_type=1 where id=‘" + id + "‘");
            Image1.Attributes.Add("width", "600px");
            Image1.Attributes.Add("height", "400px");
        }
    }
}
时间: 2025-01-20 06:54:27

发送邮件及截图,后台查看的相关文章

expdp 后台查看

今天在执行导数据的命令expdp之后发现少放了一个参数,赶紧CTRL+C,谁这个操作只能表面cancel这个操作,其实后台还在运行. system/******** schemas=CEN_DEV_OWNER20130506,CEN_DEV_USER20130506 directory=exp_dir dumpfile=expdp_cen052701.dmp,expdp_cen052702.dmp,expdp_cen052703.dmp,expdp_cen052704.dmp,expdp_cen

CSHOP后台设置SMTP发邮件提示 Error: need RCPT command 错误解决

其实错误原因并不是因为此错误,经检测,邮件服务器返回的真实错误是 501 mail from address must be same as authorization user .只因为同时返回了 503 Error: need MAIL command 和 503 Error: need RCPT command ,而ECSHOP只提示了最后一行错误. <br>220 smtp.qq.com Esmtp QQ Mail Server<br>250-smtp.qq.com250-

【C#】Windows服务守护并发送邮件通知

1. App.config 配置 <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> </startup> <appSettings>

System.Net.Mail的应用,后端发送邮件

private void btn_send_Click(object sender, EventArgs e) { var emailAcount = ConfigurationManager.AppSettings["EmailAcount"]; var emailPassword = ConfigurationManager.AppSettings["EmailPassword"]; var reciver = txt_Reciver.Text; var con

C#利用System.Net发送邮件

啥也不说了,直接上干货 using System.Net.Mail;using System.Net; //使用发送邮件的邮箱 var emailAcount = "[email protected]"; //邮箱授权码(改成上面对应邮箱的) var emailPassword = "邮箱授权码"; var reciver = "[email protected]"; var content = "邮件发送的内容"; Mail

7天撸完KTV点歌系统,含后台管理系统(完整版)

博客园好丑啊,请看掘金文章 7天撸完KTV点歌系统,含后台管理系统(完整版) 最近手有点痒琢磨着做个啥,朝思暮想还是写个KTV点歌系统,模拟了一下KTV开户的思路,7天累死我了,不过技术点还挺多的,希望你可以看完(?^?^)? 用Node(Express)教你写KTV点歌系统,包括前台内容和后台管理系统,整合Express框架和Mongodb数据库服务器开发:教你用Vue.JS,ElementUI和iViewUI写出超漂亮的页面,随心点歌随心听 1 作者原创文章, 转载前请留言或联系作者!!!

【转】Prestashop SMTP模式发送邮件客户邮件(联系我们页面)收到不的解决办法

Prestashop 一般默认使用 mail 函数发送邮件,邮件发送的IP地址就是服务器或者共享空间的IP地址.共享空间上面的网站很多,可能存在发送垃圾邮件的网站,导致共享空间的IP地址被其 他邮件服务商(gmail.hotmail等等)加入黑名单,使用mail发送的邮件全部不能够发送成功. 更换使用第三方邮件来发送邮件,Prestashop 后台设置的发送邮件模式更换成SMTP. 经过测试发现:使用SMTP发送邮件,当发件人为非SMTP账户邮箱时,发送邮件成功,但是收件人收不到邮件. 联系我们

Web项目后台测试流程

1. 本地下载项目源码 1. Git clone项目代码到本地(本地项目代码1)并fetch: 2. Switch到master分支: 3. Create测试分支(例如:test1)并勾选“Switch to new branch”: 4. Push to remote: 5. Merge开发分支到本地测试分支(test1): 6. Push to remote. 至此测试分支已经在远端存在了(不过此时的测试分支代码和开发分支代码是相同的)并且已经在本地切换到了该测试分支. 2. 编写测试代码

DocCms存储型XSS+后台任意文件下载上传+目录删除+sql执行(有条件可getshell)

下载链接 https://share.weiyun.com/46ebceb4fe91da144ad2661522a941e1 留言处存储型XSS 漏洞在content/guestbook/index.php function create() { echo 123; global $db,$request; if ($_SESSION['verifycode'] != $request['checkcode']) { echo '<script>alert("请正确填写验证码!&qu