Advertisement
Guest User

Untitled

a guest
Sep 16th, 2015
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1.  
  2. require "phpmailer/class.phpmailer.php";
  3. $mail = new PHPMailer(true);
  4. // allungo il tempo di post
  5. set_time_limit(3600);
  6.  
  7.  
  8.  
  9. try {
  10. // allungo il tempo di post
  11. set_time_limit(30);
  12.  
  13.  
  14. // 'Email inviata correttamente';
  15. $mail->IsSMTP(); // set mailer to use SMTP
  16. $mail->SMTPAuth = true;
  17. $mail->From = "ilmio_1976@libero.it";
  18. $mail->FromName = "Nome di chi invia";
  19. $mail->Host = "smtp.libero.it"; // specify main and backup server
  20. $mail->Port = 465; // Porta SMTP
  21. $mail->Username = "ilmio_1976@libero.it"; // SMTP account username
  22. $mail->Password = "ammaccabanan3"; // SMTP account password
  23.  
  24. $mail->AddAddress("$email", "INVIO"); // name is optional
  25. $mail->AddAddress("info@xxxxxx.it", "TEST"); // name is optional
  26. $mail->AddReplyTo("info@xxxxx.it", "");
  27. $mail->WordWrap = 50; // set word wrap
  28.  
  29. $mail->IsHTML(true); // set email format to HTML
  30. $mail->Subject = "Oggetto email";
  31. $mail->Body = "questo e il corpo della email";
  32.  
  33.  
  34. # }
  35. $mail->Send();
  36. }
  37. catch (phpmailerException $e)
  38. {
  39. echo "<SCRIPT LANGUAGE='JavaScript'>";
  40. echo "alert (\"ERRORE INVIO E-MAIL $e !\");";
  41. echo "window.location.href=\"index.php\"";
  42. echo "</SCRIPT>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement