noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
mail_parameter-input.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19*/
20// Copyright Author Dany De Bontridder danydb@noalyss.eu 21.10.2025
21
22if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
23/**
24 * @file
25 * @brief input parameter for Mail_Parameter
26 *
27 */
28use PHPMailer\PHPMailer\PHPMailer;
29use PHPMailer\PHPMailer\SMTP;
30
31
33// var $show (string) show or not the FORM for the SMTP
34$show=($this->smtp_type=="sendmail")?"none":"grid";
35?>
36<div class="content">
37<div class="inner_box" id="smtp_test_div" style="display:none">
38 <?= \HtmlInput::title_box(_("Test"), "smtp_test_div", "hide") ?>
39 <div style="display:flex;padding:1rem">
40 <div>
41 <label for="email_test"><?= _("Email destination") ?></label>
42 </div>
43 <div>
44 <input name="email_test_input" id="email_test_input" type="text" class="input_text" >
45 </div>
46 </div>
47 <div id="result_test_div" style="padding:1rem"></div>
48 <div>
49 <ul class="aligned-block">
50 <li>
51
52 <button class="smallbutton" onclick="noalyss.parameter_test_smtp();return false;"><?= _("Tester la configuration") ?></button>
53 </li>
54 <li>
55 <?php echo \HtmlInput::button_hide("smtp_test_div") ?>
56 </li>
57 </ul>
58 </div>
59</DIV>
60<FORM id="form_config_smtp" method="POST" onsubmit="noalyss.save_config_smtp();return false;">
61 <div id="form_email_setting_div" >
62 <?php
63 print \HtmlInput::hidden("ac",$http->request("ac"));
64 print \HtmlInput::hidden("gDossier",$http->request("gDossier"));
65 ?>
66 <div style="display: grid; grid-template-rows: auto;align-content: center;" >
67 <div>
68 <p class="text-muted">
69 <?= _("Voulez-vous envoyer les emails grâce à un serveur SMTP ou en local avec sendmail") ?>
70 </p>
71 </div>
72 <div>
73 <label for="smtp_type"><?= _("Serveur") ?></label>
74 <select name="smtp_type" id="smtp_type" onchange="noalyss.parameter_display_smtp()">
75 <option value="smtp"
76 <?= ($this->smtp_type == 'smtp') ? "selected" : "" ?>
77 >Serveur SMTP</option>
78 <option
79 <?= ($this->smtp_type == 'sendmail') ? "selected" : "" ?>
80 value="sendmail">Sendmail</option>
81 </select>
82 </div>
83
84 <div>
85 <label for="smtp_from"><?= _("adresse par défaut email de l'expéditeur") ?></label>
86 </div>
87 <div>
88 <input name="smtp_from" type="text" class="input_text" value="<?= $this->smtp_from ?>">
89 </div>
90 <div>
91 <label for="smtp_replyto"><?= _("adresse par défaut de réponse") ?></label>
92 </div>
93 <div>
94 <input name="smtp_replyto" type="text" class="input_text" value="<?= $this->smtp_replyto ?>">
95 </div>
96 <div style="margin-top:1rem">
97 <input type="SUBMIT" class="smallbutton" value="Sauver" id="btn_save1">
98 </div>
99 </div>
100 <div style="display: <?=$show?>; grid-template-rows: auto;align-content: center;" id="smtp_config_div">
101 <div>
102 <label for="smtp_user"><?= _("login") ?></label>
103 </div>
104 <div>
105 <input name="smtp_user" type="text" class="input_text" value="<?= $this->smtp_user ?>" width="80">
106 </div>
107 <div>
108 <label for="smtp_password"><?= _("Mot de passe") ?></label>
109 </div>
110 <div>
111 <input name="smtp_password" type="text" class="input_text" value="<?= $this->smtp_password ?>">
112 </div>
113 <div>
114 <label for="smtp_host"><?= _("Serveur") ?></label>
115 </div>
116 <div>
117 <input name="smtp_host" type="text" class="input_text" value="<?= $this->smtp_host ?>">
118 </div>
119 <div>
120 <label for="smtp_port"><?= _("Port") ?></label>
121 </div>
122 <div>
123 <input name="smtp_port" type="text" class="input_text" value="<?= $this->smtp_port ?>" accept="[0-9]*" >
124 </div>
125 <div>
126 <label for="smtp_auth_type"><?= _("Type authentification") ?></label>
127 </div>
128 <div>
129 <select name="smtp_auth_type">
130 <option value="CRAM-MD5"
131 <?= ($this->smtp_auth_type == 'CRAM-MD5') ? "selected" : "" ?>
132 >
133 CRAM-MD5
134 </option>
135
136 <option value="LOGIN"
137 <?= ($this->smtp_auth_type == 'LOGIN') ? "selected" : "" ?>
138 >
139 LOGIN
140 </option>
141
142 <option value="PLAIN"
143 <?= ($this->smtp_auth_type == 'PLAIN') ? "selected" : "" ?>
144 >
145 PLAIN
146 </option>
147
148
149
150 </select>
151
152 </div>
153 <div>
154 <label for="smtp_secure"><?= _("Encryption") ?></label>
155 </div>
156 <div>
157 <select name="smtp_secure" type="select" >
158 <option value="<?= PHPMailer::ENCRYPTION_STARTTLS ?>"
159 <?= ($this->smtp_type == PHPMailer::ENCRYPTION_STARTTLS) ? "selected" : "" ?>
160 >
161 ENCRYPTION_STARTTLS
162 </option>
163 <option value="<?= PHPMailer::ENCRYPTION_SMTPS ?>"
164 <?= ($this->smtp_type == PHPMailer::ENCRYPTION_SMTPS) ? "selected" : "" ?>
165 >
166 ENCRYPTION_SMTPS
167 </option>
168 </select>
169 </div>
170 <div><!-- comment -->
171 <button class="smallbutton" onclick="$('smtp_test_div').show();$('result_test_div').update('');return false"><?=_("Tester la configuration")?></button>
172 </div>
173 <div style="margin-top:1rem">
174 <input type="SUBMIT" class="smallbutton" value="Sauver">
175 </div>
176 </div>
177 </div>
178</FORM>
179<script>
180 noalyss.parameter_display_smtp();
181</script>
182</div>
p($p_string, $p_extra='')
Definition ac_common.php:39
for( $i=0; $i< $nb_row; $i++)
$ret label
$opd_description style
$from_poste name
$input_from id
_("actif, passif,charge,...")
$input_from type
for($j=0;$j< $nb_row;$j++)($j%2==0)? 'even' $show
manage the http input (get , post, request) and extract from an array
Send email for Noalyss after checking if it is possible : if cannot be sent if the limit of max email...
$desc width