<%@ Page Language="C#" MasterPageFile="~/Admin/MainPage.Master" AutoEventWireup="true" CodeBehind="mailSetting.aspx.cs" Inherits="PPFOR.Admin.Sys.WebConfig.Config.mailSetting" Title="邮件参数设置" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PPFOR_mainContent" runat="server">
<script type="text/javascript">
function checkTestMailAddress()
{
    var obj=document.getElementById("<%=PPFOR_mailSendTestAddress.ClientID %>");
    var reg= /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    if(obj!=null && obj.value!='' && reg.test(obj.value)){
        return true;
    }
    else{
        alert('请先正确填写测试邮件地址');
        return false;
    }
}
</script>

<form id="form1" runat="server">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-color:#D1D2CF" class="fortable">       
        <thead>
        <tr>
            <td colspan="2" align="center">邮件参数设置</td>
        </tr>
        </thead>
        <tr>
          <td align="right" style="width:20%">发送人邮箱：</td>
          <td><asp:TextBox ID="PPFOR_mailSendFromAddress" Width="200px" MaxLength="255" runat="server"></asp:TextBox>
          <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" Display="Dynamic" SetFocusOnError="true" ControlToValidate="PPFOR_mailSendFromAddress" ValidationExpression="^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$">邮箱地址格式错误</asp:RegularExpressionValidator>
          </td>
       </tr>
       <tr>
          <td align="right">验证用户名：</td>
          <td><asp:TextBox ID="PPFOR_mailSendUserName" Width="200px" MaxLength="255" runat="server"></asp:TextBox>          
          </td>
        </tr>
        <tr>
          <td align="right">验证密码：</td>
          <td><asp:TextBox ID="PPFOR_mailSendPassword" MaxLength="255" TextMode="Password" Width="200px" runat="server"></asp:TextBox>
          </td>
        </tr>
        <tr>
          <td align="right">邮件服务器SMTP：</td>
          <td><asp:TextBox ID="PPFOR_mailSendSMTPServer" Width="200px" MaxLength="255" runat="server"></asp:TextBox> 
          <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" Display="Dynamic" SetFocusOnError="true" ControlToValidate="PPFOR_mailSendSMTPServer" ValidationExpression="^\w+([-+.]\w+)*$">SMTP服务器地址格式错误</asp:RegularExpressionValidator></td>
        </tr>        
        <tr>
          <td align="right">端口号：</td>
          <td><asp:TextBox ID="PPFOR_mailSendPort" Width="50px" MaxLength="5" runat="server"></asp:TextBox>
            <asp:RangeValidator ID="RangeValidator1" ControlToValidate="PPFOR_mailSendPort" MaximumValue="99999" MinimumValue="1" Type="Integer" runat="server" ErrorMessage="端口号必须填写1至99999之间的整数" Display="Dynamic" SetFocusOnError="true"></asp:RangeValidator></td>
        </tr>        
        <tr>
          <td align="right">是否需要安全连接(SSL)：</td>
          <td><asp:CheckBox ID="PPFOR_mailSendNeedSSL" runat="server"/></td>
        </tr>
        <tr>
          <td align="right">测试邮件地址：</td>
          <td><asp:TextBox ID="PPFOR_mailSendTestAddress" runat="server" Width="200px" MaxLength="255"></asp:TextBox>          
          <asp:Button ID="PPFOR_mailSendTestMail" CssClass="inputbutton" runat="server" Text="发送测试邮件" OnClick="PPFOR_sendTestMailClick" OnClientClick="return checkTestMailAddress();" /><br />
          <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" Display="Dynamic" SetFocusOnError="true" ControlToValidate="PPFOR_mailSendTestAddress" ValidationExpression="^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$">邮箱地址格式错误</asp:RegularExpressionValidator>
          </td>
        </tr>
        <tr>
          <td colspan="2" align="center" style="height:50px; display:none;"><asp:Button ID="PPFOR_mailSaveSetting" CssClass="inputbutton" Text="保存设置" runat="server" OnClick="PPFOR_mailSaveSettingClick" />
          <input name="reset" id="reset1" type="reset" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" value="重置"/>
            <script type="text/javascript">
                addButtonArray("<%= PPFOR_mailSaveSetting.ClientID %>","reset1");
            </script>
          </td>
        </tr>
      </table>
  </form>
</asp:Content>
