Advertisement
Guest User

Untitled

a guest
Jan 25th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. require_once('class.phpmailer.php');
  4. require_once('class.smtp.php');
  5. $mail = new PHPMailer;
  6. $mail->isSMTP();
  7. $mail->Host = 'mail.ovh.net';
  8. $mail->SMTPAuth = true;
  9. $mail->Username = 'no-reply@piiiblo.fr';
  10. $mail->Password = '604s8R067274GHN';
  11. $mail->SMTPSecure = 'tls';
  12. $mail->SMTPOptions = array(
  13.     'ssl' => array(
  14.         'verify_peer' => false,
  15.         'verify_peer_name' => false,
  16.         'allow_self_signed' => true
  17.     )
  18. );
  19. $mail->Port = 25;
  20.  
  21. $mail->setFrom('no-reply@piiiblo.fr', 'Contact piiiblo.fr');
  22. $mail->addAddress('piiiblo.pro@gmail.com');
  23.  
  24. $mail->isHTML(true);
  25.  
  26. $mail->CharSet = 'UTF-8';
  27. $mail->Subject = 'Conctact depuis piiiblo.fr';
  28. $mail->Body = 'Bonjour,<br>Quelqu'un vous a écrit depuis piiiblo.fr !<br><br>Nom : ' . $_POST['name'] . '<br>Mail : ' . $_POST['mail'] . '<br>Message : ' . $_POST['message'] . '<br><br>Bisous bb';
  29.  
  30. if (!$mail->send()) {
  31.    echo 'Message could not be sent.';
  32.    echo 'Mailer Error: ' . $mail->ErrorInfo;
  33. } else {
  34.    header('Location: index.html');
  35. }
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement