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; } } }