Buon pomeriggio a tutti.
Solitamente utilizzo il pacchetto phpmailer per l'invio delle mail con indirizzi standard.
Ora, devo inviarle tramite pec.
Ho preso visione attraverso questo link https://guide.pec.it/posta-pec/confi...mma-posta.aspx sul come parametrizzare le variabili di phpmailer ed ho fatto cosi:
Non c'è verso che invia.Codice PHP:
function setUp() {
$this->Mail = new PHPMailer();
$this->Mail->Priority = 1;
$this->Mail->Encoding = "8bit";
$this->Mail->CharSet = "iso-8859-1";
$this->Mail->From = "areaverde@cert.azienda.it";
$this->Mail->Host = "smtps.pec.aruba.it";
$this->Mail->Port = 465;
$this->Mail->Helo = "";
$this->Mail->SMTPAuth = true;
$this->Mail->SMTPSecure = "SSL";
$this->Mail->SMTPDebug = true;
$this->Mail->Username = "areaverde@cert.azienda.it";
$this->Mail->Password = "lamiapassword";
if(strlen($this->Mail->Host) > 0)
$this->Mail->Mailer = "smtps";
else{
$this->Mail->Mailer = "mail";
}
}
function test_Html() {
$this->Mail->Body = "";
$this->Mail->IsHTML(true);
$this->Mail->Body .= "<p>Buona giornata</p>";
$this->Mail->IsHTML(true);
$this->Mail->AddAddress("mariorossi@pec.it");
if(!$this->Mail->Send()){
echo "La mail non é stata inviata al seguente indirizzo: mariorossi@pec.it";
}else{
echo "La mail è stata inviata al seguente indirizzo: mariorossi@pec.it";
}
}
Mi aiutate per favore?
Grazie a tutti.