Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2017
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1. <?php include 'mysql.php'; ?>
  2. dssdfffasfsfsf
  3. <?php
  4.  
  5. //exit('fuffa');
  6. //echo($tipoutente);
  7. $mail = isset($_POST['mail']) ? $_POST['mail'] : '';
  8.  
  9.  
  10. //dati UTENTE
  11. $query = 'SELECT * FROM utenti WHERE username = ' . $mail;
  12. $res = mysql_query($query);
  13. $row = mysql_fetch_assoc($res);
  14. //echo ($query);
  15. $username = $row['username'];
  16. $password = $row['password'];
  17. $nome = $row['nome'];
  18. $cognome = $row['cognome'];
  19. $email = $row['mail'];
  20.  
  21. //header('location:registrato.php');
  22. //echo($username);
  23. //echo($password);
  24.  
  25. if ($email == '') {
  26.     header('location:recupero.php?err=1')
  27.         } else {
  28.  
  29.     // MANDAMAIL
  30.     //invio mail
  31.     require_once 'swift/lib/swift_required.php';
  32.  
  33.     $mail = 'mail/recupero.html';
  34.     $html = file_get_contents($mail);
  35.     $html = str_replace("#USERNAME", $username, $html);
  36.     $html = str_replace("#PASSWORD", $password, $html);
  37.     $html = str_replace("#NOME", $nome, $html);
  38.     $html = str_replace("#COGNOME", $cognome, $html);
  39.  
  40.     // Create the Transport
  41.     $transport = Swift_SmtpTransport::newInstance('mail.promotionplus.it', 25)
  42.         ->setUsername('raceandgo@promotionplus.it')
  43.         ->setPassword('pplus0');
  44.  
  45.     // Create the Mailer using your created Transport
  46.     $mailer = Swift_Mailer::newInstance($transport);
  47.     //echo ("provccc");
  48.     // Create a message
  49.     $message = Swift_Message::newInstance('Registrazione race and go')
  50.         ->setFrom(array('raceandgo@promotionplus.it' => 'Race and go'))
  51.         ->setTo(array($email))
  52.         ->setBody($html, 'text/html');
  53.  
  54.     // Send the message
  55.     if (!$mailer->send($message, $failures)) {
  56.         echo "Failures:";
  57.         print_r($failures);
  58.     } else {
  59.         header('location: registrato.php');
  60.     }
  61. }
  62. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement