47use PHPMailer\PHPMailer\PHPMailer;
48use PHPMailer\PHPMailer\SMTP;
109 throw new \Exception(
"MP72 : unknown $key");
111 $this->a_value[$key] =
$value;
126 throw new \Exception(
"MP79 : unknown $key");
128 if (isset($this->a_value[$key]))
130 return $this->a_value[$key];
140 foreach (self::PARAMETER as $key)
142 $id = $this->
cn->get_value(
"select pe_id from parm_mail_server
143 where pe_parameter=$1
145 [$key, $this->
name]);
148 $record = new \Parm_Mail_Server_SQL($this->
cn);
149 $record->set(
"pe_name", $this->
name);
150 $record->set(
"pe_parameter", $key);
151 $record->set(
"pe_value", $this->a_value[$key]);
155 $record = new \Parm_Mail_Server_SQL($this->
cn,
$id);
156 $record->set(
"pe_value", $this->a_value[$key]);
168 $this->
cn->get_array(
"select pe_parameter , pe_value from
169 public.parm_mail_server
173 ,
"pe_value",
"pe_parameter"
176 foreach (self::PARAMETER as $key)
178 $this->a_value[$key] =
$a_value[$key] ??
"";
200 include NOALYSS_TEMPLATE .
"/mail_parameter-input.php";
207 $http = new \HttpInput();
208 $this->smtp_user =
$http->get(
'smtp_user');
209 $this->smtp_password =
$http->get(
'smtp_password');
210 $this->smtp_host =
$http->get(
'smtp_host');
211 $this->smtp_port =
$http->get(
'smtp_port');
212 $this->smtp_replyto =
$http->get(
'smtp_replyto');
213 $this->smtp_from =
$http->get(
'smtp_from');
214 $this->smtp_type=
$http->get(
'smtp_type');
215 $this->smtp_secure =
$http->get(
'smtp_secure');
216 $this->smtp_auth_type =
$http->get(
'smtp_auth_type');
225 $http = new \HttpInput();
226 $this->smtp_user =
$http->post(
'smtp_user');
227 $this->smtp_password =
$http->post(
'smtp_password');
228 $this->smtp_host =
$http->post(
'smtp_host');
229 $this->smtp_port =
$http->post(
'smtp_port');
230 $this->smtp_replyto =
$http->post(
'smtp_replyto');
231 $this->smtp_from =
$http->post(
'smtp_from');
232 $this->smtp_type=
$http->post(
'smtp_type');
233 $this->smtp_secure =
$http->post(
'smtp_secure');
234 $this->smtp_auth_type =
$http->post(
'smtp_auth_type');
241 if ( $mail_parameter->smtp_type==
"sendmail") {
242 return new \Sendmail($mail_parameter->smtp_replyto,$mail_parameter->smtp_replyto);
243 }
elseif ($mail_parameter->smtp_type==
"smtp") {
244 $phpmail=
new SMTPMail($mail_parameter);
248 throw new \Exception(
"MP212 MAIL NOT CONFIGURED",212);
contains the class for connecting to Noalyss
configuration email and test PHPMAILER.
static Factory(\Database $cnx, $reply_to="", $blind_copy="")
__get($key)
get the value in the array $a_value thkx the key
__set($key, $value)
set the value in the array $a_value thkx the key
save()
save into the database
input()
display a form to input the parameter
load()
load from the database
$a_value
$a_value array of PARAMETER=>Value
from_post()
retrieve information from POST
__construct(protected \Database $cn, protected $name)
from_get()
retrieve information from GET
const MAIL_SETTING_NOALYSS
if( $delta< 0) elseif( $delta==0)