{include file="header.html"}
<script type="text/javascript">
$(function(){
    $('#send_test_email').click(send_test_email);
});
function send_test_email(){
    var email_type = $('input[name="email_type"]:checked').val();
    $.ajax({
        type:"POST",
        url:"index.php",
        data:'app=setting&act=send_test_email&email_type='+email_type+'&email_host='+$("#email_host").val()+'&email_port='+$("#email_port").val()+'&email_addr='+$("#email_addr").val()+'&email_id='+$("#email_id").val()+'&email_pass='+$("#email_pass").val()+'&email_test='+$("#email_test").val(),
        dataType:"json",
        success:function(data){
            if(data.done){
            alert(data.msg);
            }
            else{
                alert(data.msg);
            }
        },
        error: function(){alert('{$lang.mail_send_failure}');}
    });
}
</script>



<div id="rightTop">
    <p>{$lang.setting}</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=setting&amp;act=base_setting">{$lang.base_setting}</a></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=base_information">{$lang.base_information}</a></li>
        <li><span>{$lang.email_setting}</span></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=captcha_setting">{$lang.captcha_setting}</a></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=store_setting">{$lang.store_setting}</a></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=credit_setting">{$lang.credit_setting}</a></li>
        <li><a class="btn1" href="index.php?app=setting&amp;act=subdomain_setting">{$lang.subdomain_setting}</a></li>
        </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    <label for="email_type">{$lang.email_type}:</label></th>
                <td class="paddingT15 wordSpacing5">
                    {html_radios name="email_type" options=$mail_type checked=$setting.email_type}
                    <label class="field_notice">{$lang.choose_email_type}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.email_host}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="email_host" type="text" name="email_host" value="{$setting.email_host}"/>
                    <label class="field_notice">{$lang.email_host_note}</label></td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.email_port}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="email_port" type="text" name="email_port" value="{$setting.email_port}"/>
                    <label class="field_notice">{$lang.email_port_note}</label></td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.email_addr}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="email_addr" type="text" name="email_addr" value="{$setting.email_addr}"/>
                    <label class="field_notice">{$lang.email_addr_note}</label></td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.email_id}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="email_id" type="text" name="email_id" value="{$setting.email_id}"/></td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.email_pass}:</th>
                <td class="paddingT15 wordSpacing5">
                <input class="infoTableInput" id="email_pass" type="password" name="email_pass" value="{$setting.email_pass}"/></td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.email_test}:</th>
                <td class="paddingT15 wordSpacing5">
                <input class="infoTableInput" id="email_test" type="text" name="email_test" value="{$setting.email_test}"/>&nbsp;&nbsp;<input id="send_test_email" class="formbtn" type="button" name="send_test_email" value="{$lang.send_test_email}" /></td>
            </tr>
            <tr>
            <th></th>
            <td class="ptb20">
                <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
            </td>
        </tr>
        </table>
    </form>
</div>
{include file="footer.html"}
