<%@ page language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="System_EmailSendingOptions, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<asp:Content ID="Content7" ContentPlaceHolderID="CPH_Content" runat="Server">

    <div class="col-xs-12">
        <div class="card">
            <div class="header">
                <h2>
                    <asp:Literal ID="Ltl_SubsInfo" runat="server" Text="<%$ Resources:Content,SM035 %>" /></h2>
            </div>
            <div class="body">
                <%--<ajax:UpdatePanel ID="UP" runat="server">
        <ContentTemplate>--%>
                <asp:Panel ID="Pnl_add" runat="server" DefaultButton="Btn_Save">
                    <div class="card Div_OpsRow" id="Div_OpsRow" runat="server">
                        <div class="header">
                            <h3><%= Resources.Content.GN00001320%></h3>
                        </div>
                        <div class="body">
                            <div class="row">
                                <div class="col-xs-12">
                                    <asp:Button ID="Btn_Send" runat="server" class="btn btn-primary waves-effect btnAction" Text="<%$ Resources:Content,String319 %>" CausesValidation="false" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <br />
                    <div class="card">
                        <div class="header">
                            <h3><%= Resources.Content.GN00001250%></h3>
                        </div>
                        <div class="body">
                            <div class="row" id="TR_UseProvider" runat="server" style="display: none;">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>
                                        <asp:Literal ID="Literal11" runat="server" Text="<%$ Resources:Content,String524%>" EnableViewState="false" />:                                
                                    </label>
                                </div>
                                <div class="col-sm-9 col-xs-12">
                                    <asp:CheckBox ID="CB_UseProvider" runat="server" AutoPostBack="true" Text=" " data-label="Use Provider Settings" />
                                </div>
                            </div>
                            <div class="row" id="Div_UseProviderFromAddressOption" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>
                                        <asp:Literal ID="Literal10" runat="server" Text="<%$ Resources:Content,UseProviderFrom%>" EnableViewState="false" />:                                
                                    </label>
                                </div>
                                <div class="col-sm-9 col-xs-12">
                                    <asp:CheckBox ID="CB_FromAddressOption" AutoPostBack="true" runat="server" Text=" " data-label="Use Provider settings for From Address" />
                                </div>
                            </div>
                            <asp:Panel ID="Pnl_Settings" runat="server">
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>
                                            *<asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:Content,GN00001251%>" EnableViewState="false" />:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_SMTPServer" runat="server" data-label="SMTP Server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxBx_SMTPServer"
                                                    Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage='<%$ Resources:Content,DGN1110038%>'
                                                    ControlToValidate="TxBx_SMTPServer" Display="None" SetFocusOnError="True" ValidationExpression="<%$ Resources:MPRegex,SMTPServer %>"
                                                    ValidationGroup="TestMail" />

                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-5 col-xs-12">
                                        <label>
                                            <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Content,GN00001362%>" /></label>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>
                                            *<asp:Literal ID="Literal6" runat="server" Text="<%$ Resources:Content,GN0000565%>" EnableViewState="false" />:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_Port" runat="server" data-label="Port"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TxBx_Port"
                                                    Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                <EM:FilteredTextBoxExtender ID="FT1" TargetControlID="TxBx_Port" FilterType="Custom"
                                                    ValidChars="0123456789" runat="server" />
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage='<%$ Resources:Content,DGN1110038%>'
                                                    ControlToValidate="TxBx_Port" Display="None" SetFocusOnError="True" ValidationExpression="<%$ Resources:MPRegex,Port %>"
                                                    ValidationGroup="TestMail" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>
                                            <asp:Literal ID="Literal12" runat="server" Text="<%$ Resources:Content,EnableSSL%>" EnableViewState="false" />:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <asp:CheckBox ID="CB_EnableSSL" runat="server" Text=" " data-label="Enable SSL" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>
                                            <asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:Content,GN000201%>" EnableViewState="false" />:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <asp:CheckBox ID="CB_Authenticate" AutoPostBack="true" runat="server" Text=" " data-label="Authentication Required" />
                                    </div>
                                </div>
                                <div class="row" id="Tr_UserName" runat="server">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>
                                            *<asp:Literal ID="Literal8" runat="server" Text="<%$ Resources:Content,GN00001253%>" EnableViewState="false" />:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_UserName" runat="server" data-label="User Name"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RFV_UserName" runat="server" ControlToValidate="TxBx_UserName"
                                                    Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                               <%-- <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ErrorMessage='<%$ Resources:Content,DGN1110038%>'
                                                    ControlToValidate="TxBx_UserName" Display="None" SetFocusOnError="True" ValidationExpression="<%$ Resources:MPRegex,EmailAddress %>"
                                                    ValidationGroup="TestMail" />--%>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row" id="Tr_Pass" runat="server">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>
                                            *<asp:Literal ID="Literal9" runat="server" Text="<%$ Resources:Content,GN0000569%>" EnableViewState="false" />:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_Password2" runat="server" TextMode="Password" data-label="Password" data-secure="1"></asp:TextBox>
                                                <%--(<asp:Literal ID="literal8" runat="server" Text='<%$ Resources:Content,GN00001530%>'></asp:Literal>)--%>
                                                <asp:CompareValidator ErrorMessage='<%$ Resources:Content,DGN1110005 %>' ID="CV_Pass"
                                                    runat="server" ControlToCompare="TxBx_Password" ControlToValidate="TxBx_Password2"
                                                    Display="None"></asp:CompareValidator>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row" id="Tr_ConfirmPass" runat="server">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>*<asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:Content,GN0001196%>" EnableViewState="false" />:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_Password" TextMode="Password" runat="server" data-state="hidden"></asp:TextBox>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row" id="Div_SPF" runat="server">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>
                                            <asp:Literal ID="Literal4" runat="server" Text="<%$ Resources:Content,SPFRecord%>" EnableViewState="false" />:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_SPFRecord" runat="server" data-label="SPF Record"></asp:TextBox>
                                            </div>
                                        </div>
                                        <asp:Literal ID="Literal7" runat="server" Text="<%$ Resources:Content,SPFRecordHint%>" EnableViewState="false" />
                                    </div>
                                </div>
                            </asp:Panel>
                            <div class="row">
                                <div class="col-xs-12">
                                    <asp:Button ID="Btn_Save" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,GN0000281 %>' />
                                </div>
                            </div>
                        </div>
                    </div>
                </asp:Panel>
                <div>
                    <asp:ValidationSummary HeaderText='<%$ Resources:Content,EM000001 %>' ShowMessageBox="true"
                        ShowSummary="false" ID="ValidationSummary1" runat="server" />
                </div>
                <%--  </ContentTemplate>
    </ajax:UpdatePanel>--%>
            </div>
        </div>
    </div>

    <ajax:UpdatePanel ID="UP_TestEmail" runat="server" UpdateMode="CONDITIONAL">
        <ContentTemplate>
            <asp:Panel ID="Pnl_TestEmail" BackColor="white" BorderColor="black" BorderStyle="Solid"
                BorderWidth="1px" ScrollBars="Auto" runat="server" Style="display: none" CssClass="width-modal-popup-auto">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="card">
                            <div class="header">
                                <h3><%= Resources.Content.String319 %></h3>
                            </div>
                            <div class="body">
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>*<asp:Label ID="Lb_SendTo" runat="server" Text="<%$ Resources:Content,String320 %>" EnableViewState="false"></asp:Label>:</label>
                                    </div>
                                    <div class="col-sm-9 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_SendTo" runat="server" ValidationGroup="TestMail"></asp:TextBox>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>*<asp:Label ID="Lb_From" runat="server" Text="<%$ Resources:Content,DGN1110162 %>" EnableViewState="false"></asp:Label>:</label>
                                    </div>
                                    <div class="col-sm-9 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_From" runat="server" ValidationGroup="TestMail"></asp:TextBox>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>*<asp:Label ID="Lb_Body" runat="server" Text="<%$ Resources:Content,String321 %>" EnableViewState="false"></asp:Label>:</label>
                                    </div>
                                    <div class="col-sm-9 col-xs-12">
                                        <div class="form-group">
                                            <asp:TextBox ID="TxBx_Body" runat="server" TextMode="MultiLine" Width="100%" Height="150px"></asp:TextBox>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12">
                                        <asp:Button class="btn btn-primary waves-effect" ID="Btn_EmailSend" runat="server"
                                            Text='<%$ Resources:Content,DGN1110199%>' ValidationGroup="TestMail" CausesValidation="true" />
                                        <asp:Button class="btn btn-primary waves-effect" ID="Btn_EmailCancel" runat="server"
                                            Text='<%$ Resources:Content,GN0000572%>' ValidationGroup="TestMail" CausesValidation="false" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </asp:Panel>
            <asp:Button ID="Btn_Dummy" runat="server" Style="display: none" Text='<%$ Resources:Content,GN0000575%>' />
            <EM:ModalPopupExtender runat="server" ID="MPE_TestEmail" BackgroundCssClass="modalBackground"
                DropShadow="false" CancelControlID="Btn_EmailCancel" PopupControlID="Pnl_TestEmail"
                TargetControlID="Btn_Dummy" />
        </ContentTemplate>
    </ajax:UpdatePanel>
    <script type="text/javascript">
        function ValidatePopup(IdSendTo, IdFrom) {
            var Txt_SendTo = document.getElementById(IdSendTo);
            var Txt_From = document.getElementById(IdFrom);
            if (Txt_SendTo != null && Txt_From != null) {



                if (Txt_SendTo.value == '') { alert(<% Response.Write("'" + Resources.Content.GN00008027 + "'")%>); Txt_SendTo.focus(); return false; }

                if (Txt_From.value == '') { alert(<% Response.Write("'" + Resources.Content.GN00008027 + "'")%>); Txt_From.focus(); return false; }

                if (!(convertToASCIIAndValidate(Txt_SendTo.value,EmailValidationExpression.toString())) { alert(<% Response.Write("'" + Resources.Content.Dev487 + "'")%>); Txt_SendTo.focus(); return false; }

                if (!(convertToASCIIAndValidate(Txt_From.value,EmailValidationExpression.toString())) { alert(<% Response.Write("'" + Resources.Content.Dev487 + "'")%>); Txt_From.focus(); return false; }

                return true;
            }
        }
    </script>
    <script lang="javascript">
        AllowArrowKeysInFilteredTextBoxExtender('<%=FT1.ClientID%>');
    </script>

</asp:Content>
