Config_mail.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <form method='post' id="form1" action="{:U('Config/dosite')}">
  2. <table width="100%" cellpadding=0 cellspacing=0 class="table_form">
  3. <tr>
  4. <th width="120">{:L('config_mail_md')}</th>
  5. <td class="y-bg">
  6. <input name="mail_type" value="1" onclick="showsmtp(this)" type="radio" <if condition="$mail_type == 1"> checked</if>> {:L('config_mail_smtp')}
  7. <input name="mail_type" value="2" onclick="showsmtp(this)" type="radio" <if condition="$mail_type == 2"> checked</if> <?php if(substr(strtolower(PHP_OS), 0, 3) == 'win') echo 'disabled'; ?>/> {:L('config_mail_mailfun')}
  8. <input name="mail_type" value="3" onclick="showsmtp(this)" type="radio" <if condition="$mail_type == 3"> checked</if>> sendmail
  9. </td>
  10. </tr>
  11. <tbody id="smtpconfig" style="">
  12. <tr>
  13. <th>{:L('config_mail_server')}</th>
  14. <td class="y-bg"><input type="text" class="input-text" name="mail_server" id="mail_server" size="30" value="{$mail_server}"/></td>
  15. </tr>
  16. <tr>
  17. <th>{:L('config_mail_port')}</th>
  18. <td class="y-bg"><input type="text" class="input-text" name="mail_port" id="mail_port" size="30" value="{$mail_port}"/></td>
  19. </tr>
  20. <tr>
  21. <th>{:L('config_mail_from')}</th>
  22. <td class="y-bg"><input type="text" class="input-text" name="mail_from" id="mail_from" size="30" value="{$mail_from}"/></td>
  23. </tr>
  24. <tr>
  25. <th>{:L('config_mail_auth')}</th>
  26. <td class="y-bg">
  27. <input name="mail_auth" id="mail_auth" value="1" type="radio" <if condition="$mail_auth == 1"> checked</if>> {:L('open_select')} <input name="mail_auth" id="mail_auth" value="0" type="radio" <if condition="$mail_auth == 0"> checked</if> > {:L('close_select')}</td>
  28. </tr>
  29. <tr>
  30. <th>{:L('config_mail_user')}</th>
  31. <td class="y-bg"><input type="text" class="input-text" name="mail_user" id="mail_user" size="30" value="{$mail_user}"/></td>
  32. </tr>
  33. <tr>
  34. <th>{:L('config_mail_password')}</th>
  35. <td class="y-bg"><input type="password" class="input-text" name="mail_password" id="mail_password" size="30" value="{$mail_password}"/></td>
  36. </tr>
  37. </tbody>
  38. <tbody id="sendmailconfig" style="">
  39. <!-- <tr>
  40. <th>{:L('config_mail_sendmail')}</th>
  41. <td class="y-bg"><input type="text" class="input-text" name="mail_sendmail" id="mail_sendmail" size="30" value="{$mail_sendmail}"/></td>
  42. </tr> -->
  43. </tbody>
  44. <tr>
  45. <th>{:L('config_mail_test')}</th>
  46. <td class="y-bg"><input type="text" class="input-text" name="mail_to" id="mail_to" size="30" value=""/> <input type="button" class="button" onClick="javascript:test_mail();" value="{:L('config_mail_testsed')}"></td>
  47. </tr>
  48. </table>
  49. <div class="btn">
  50. <INPUT TYPE="submit" value="{:L('save')}" class="button buttonBtn" >
  51. <input TYPE="reset" value="{:L('reset')}" class="button">
  52. </div>
  53. </form>
  54. </div>
  55. <script>
  56. function showsmtp(obj){
  57. if(obj){
  58. var issmtp = $(obj).val();
  59. }else{
  60. var issmtp = $("input[name=mail_type][checked]").val();
  61. }
  62. if(issmtp==1){
  63. $('#smtpconfig').show();
  64. $('#sendmailconfig').hide();
  65. }else if(issmtp==3){
  66. $('#smtpconfig').hide();
  67. $('#sendmailconfig').show();
  68. }else{
  69. $('#smtpconfig').hide();
  70. $('#sendmailconfig').hide();
  71. }
  72. }
  73. function test_mail(){
  74. var mail_type = $("input[name=mail_type][checked]").val();
  75. $.post('{:U("Config/testmail")}&mail_to='+$('#mail_to').val(),{mail_type:mail_type,mail_sendmail:$('#mail_sendmail').val(),mail_server:$('#mail_server').val(),mail_port:$('#mail_port').val(),mail_user:$('#mail_user').val(),mail_password:$('#mail_password').val(),mail_auth:$('#mail_auth').val(),mail_auth:$('#mail_auth').val(),mail_from:$('#mail_from').val()}, function(data){
  76. alert(data.info);
  77. },"json");
  78. }
  79. showsmtp();
  80. </script>