Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
31 righe
1.1 KiB
31 righe
1.1 KiB
<? |
|
use PHPMailer\PHPMailer\PHPMailer; |
|
$pre = $_POST["pec"]; |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$edit = false; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) { |
|
if (isset($_POST["pec"]) && is_array($_POST["pec"])) { |
|
foreach ($_POST["pec"] as $i => $_POST) { |
|
$messaggio = __("Operazione effettuata con successo"); |
|
// include_once ($beRoot . "/inc/phpmailer/PHPMailerAutoload.php"); |
|
$mail = new PHPMailer(); |
|
$mail->IsSMTP(); |
|
$mail->Host = $_POST["smtp"]; |
|
$mail->Port = $_POST["smtp_port"]; |
|
if ($_POST["usa_ssl"]=="1") $mail->SMTPSecure = 'ssl'; |
|
$mail->SMTPAuth = true; |
|
$mail->Username = $_POST["pec"]; |
|
$mail->Password = $pre[$i]["password"]; |
|
$mail->SetFrom($_POST["pec"]); |
|
$mail->AddAddress($_POST["pec"]); |
|
$mail->Subject = $_SESSION["config"]["nome_sito"] . " - " . "Test configurazione PEC"; |
|
$mail->MsgHTML("La configurazione inserita funziona correttamente!"); |
|
if(!$mail->Send()){ |
|
$messaggio = $mail->ErrorInfo; |
|
} |
|
unset($mail); |
|
echo $messaggio; |
|
} |
|
} |
|
}
|
|
|