Merge pull request #5536 from totten/4.5-httpclient
[civicrm-core.git] / templates / CRM / Admin / Form / Setting / Smtp.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25 *}
26 <div class="crm-block crm-form-block crm-smtp-form-block">
27 <div id="help">
28 <p>{ts}CiviCRM offers several options to send emails. The default option should work fine on linux systems. If you are using windows, you probably need to enter settings for your SMTP/Sendmail server. You can send a test email to check your settings by clicking "Save and Send Test Email". If you're unsure of the correct values, check with your system administrator, ISP or hosting provider.{/ts}</p>
29 <p>{ts}If you do not want users to send outbound mail from CiviCRM, select "Disable Outbound Email". NOTE: If you disable outbound email, and you are using Online Contribution pages or online Event Registration - you will need to disable automated receipts and registration confirmations.{/ts}</p>
30 <p>{ts}If you choose Redirect to Database, all emails will be recorded as archived mailings instead of being sent out. They can be found in the civicrm_mailing_spool table in the CiviCRM database.{/ts}</p>
31
32 </div>
33 <table class="form-layout-compressed">
34 <tr class="crm-smtp-form-block-outBound_option">
35 <td class="label">{$form.outBound_option.label}</td>
36 <td>{$form.outBound_option.html}</td>
37 </tr>
38 </table>
39 <div id="bySMTP" class="mailoption">
40 <fieldset>
41 <legend>{ts}SMTP Configuration{/ts}</legend>
42 <table class="form-layout-compressed">
43 <tr class="crm-smtp-form-block-smtpServer">
44 <td class="label">{$form.smtpServer.label}</td>
45 <td>{$form.smtpServer.html}<br />
46 <span class="description">{ts}Enter the SMTP server (machine) name, such as "smtp.example.com". If the server uses SSL, add "ssl://" to the beginning of the server name, such as "ssl://smtp.example.com".{/ts}</span>
47 </td>
48 </tr>
49 <tr class="crm-smtp-form-block-smtpPort">
50 <td class="label">{$form.smtpPort.label}</td>
51 <td>{$form.smtpPort.html}<br />
52 <span class="description">{ts}The most common SMTP port possibilities are 25, 465, and 587. Check with your mail provider for the appropriate one.{/ts}</span>
53 </td>
54 </tr>
55 <tr class="crm-smtp-form-block-smtpAuth">
56 <td class="label">{$form.smtpAuth.label}</td>
57 <td>{$form.smtpAuth.html}<br />
58 <span class="description">{ts}Does your SMTP server require authentication (user name + password)?{/ts}</span>
59 </td>
60 </tr>
61 <tr class="crm-smtp-form-block-smtpUsername">
62 <td class="label">{$form.smtpUsername.label}</td>
63 <td>{$form.smtpUsername.html}</td>
64 </tr>
65 <tr class="crm-smtp-form-block-smtpPassword">
66 <td class="label">{$form.smtpPassword.label}</td>
67 <td>{$form.smtpPassword.html}<br />
68 <span class="description">{ts}If your SMTP server requires authentication, enter your Username and Password here.{/ts}</span>
69 </td>
70 </tr>
71 </table>
72 </fieldset>
73 </div>
74 <div id="bySendmail" class="mailoption">
75 <fieldset>
76 <legend>{ts}Sendmail Configuration{/ts}</legend>
77 <table class="form-layout-compressed">
78 <tr class="crm-smtp-form-block-sendmail_path">
79 <td class="label">{$form.sendmail_path.label}</td>
80 <td>{$form.sendmail_path.html}<br />
81 <span class="description">{ts}Enter the Sendmail Path. EXAMPLE: /usr/sbin/sendmail{/ts}</span>
82 </td>
83 </tr>
84 <tr class="crm-smtp-form-block-sendmail_args">
85 <td class="label">{$form.sendmail_args.label}</td>
86 <td>{$form.sendmail_args.html}</td>
87 </tr>
88 </table>
89 </fieldset>
90 </div>
91 <div class="spacer"></div>
92 <div class="crm-submit-buttons">
93 {include file="CRM/common/formButtons.tpl"}
94 </div>
95 </div>
96
97 {literal}
98 <script type="text/javascript">
99 CRM.$(function($) {
100 var mailSetting = $("input[name='outBound_option']:checked").val( );
101
102 var archiveWarning = "{/literal}{ts escape='js'}WARNING: You are switching from a testing mode (Redirect to Database) to a live mode. Check Mailings > Archived Mailings, and delete any test mailings that are not in Completed status prior to running the mailing cron job for the first time. This will ensure that test mailings are not actually sent out.{/ts}{literal}"
103
104 showHideMailOptions( $("input[name='outBound_option']:checked").val( ) ) ;
105
106 function showHideMailOptions( value ) {
107 switch( value ) {
108 case "0":
109 $("#bySMTP").show( );
110 $("#bySendmail").hide( );
111 $("#_qf_Smtp_refresh_test").prop('disabled', false);
112 if (mailSetting == '5') {
113 alert(archiveWarning);
114 }
115 break;
116 case "1":
117 $("#bySMTP").hide( );
118 $("#bySendmail").show( );
119 $("#_qf_Smtp_refresh_test").prop('disabled', false);
120 if (mailSetting == '5') {
121 alert(archiveWarning);
122 }
123 break;
124 case "3":
125 $('.mailoption').hide();
126 $("#_qf_Smtp_refresh_test").prop('disabled', false);
127 if (mailSetting == '5') {
128 alert(archiveWarning);
129 }
130 break;
131 default:
132 $("#bySMTP").hide( );
133 $("#bySendmail").hide( );
134 $("#_qf_Smtp_refresh_test").prop('disabled', true);
135 }
136 }
137
138 $("input[name='outBound_option']").click( function( ) {
139 showHideMailOptions( $(this).val( ) );
140 });
141 });
142
143 </script>
144 {/literal}