Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- PRIMO METODO CHE NON FUNZIONA
- require 'class.phpmailer.php';
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->SMTPAuth = true;
- $mail->Host = "smtps.aruba.it";
- $mail->SMTPSecure = "ssl"; // Enable 'tls' encryption, `ssl` also accepted
- $mail->Port = 465;
- $mail->Username = "";
- $mail->Password = "****";
- // EMAIL
- $mail->SetFrom("[email protected]", 'Amministratore Utente (da Home)');
- $mail->Subject ='Email di prova con phpmailer';
- $body = '<p>Testo della mail..</p>';
- $mail->MsgHTML($body);
- $mail->AddAddress("[email protected]","Nome");*/
- // SECONDO METODO CHE NON FUNZIONA
- include("class.phpmailer.php");
- $nomemittente = "Amministratore Utente (da Home)";
- $ServerSMTP = "smtps.aruba.it"; //server SMTP
- $corpo_messaggio = "Grazie per averci contattato!!\n"
- ."Cordiali Saluti,\nServizio Clienti";
- $messaggio = new PHPMailer();
- // utilizza la classe SMTP invece del comando mail() di php
- $messaggio->IsSMTP();
- $messaggio->SMTPKeepAlive = "true";
- $messaggio->Host = $ServerSMTP;
- $messaggio->From = $mittente;
- $messaggio->FromName = $nomemittente;
- $messaggio->AddAddress($destinatario);
- $messaggio->Body = $corpo_messaggio;
- if(!$messaggio->Send()) {
- echo "errore nella spedizione: ".$messaggio->ErrorInfo;
- } else {
- echo "messaggio inviato correttamente";
- }
Advertisement
Add Comment
Please, Sign In to add comment