Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. //contact_us.php
  2.  
  3. <form class="form" action="mail.php" method="post">
  4.     <input type="text" class="wp-form-control wpcf7-text" placeholder="Nama" name="name">
  5.     <input type="text" class="wp-form-control wpcf7-text" placeholder="Nomor Telepon" name="tlp">
  6.     <input type="mail" class="wp-form-control wpcf7-email" placeholder="Alamat Email" name="email">
  7.     <textarea class="wp-form-control wpcf7-textarea" cols="30" rows="10" placeholder="Apa yang ingin anda sampaikan kepada kami atau keluhan anda" name="message"></textarea>
  8.     <button class="wpcf7-submit button--itzel" type="submit">
  9.     <span>Kirim</span></a>
  10.     <i class="button__icon fa fa-envelope">Kirim</i>
  11.     </button>                
  12. </form>
  13.  
  14. //mail.php
  15.  
  16. <?php
  17. include "classes/class.phpmailer.php";
  18.  
  19. $name=$_POST['name'];
  20. $tlp=$_POST['tlp'];
  21. $email=$_POST['email'];
  22. $message=$_POST['message'];
  23.  
  24. $mail = new PHPMailer;
  25. $mail->IsSMTP();
  26. $mail->SMTPSecure = 'ssl';
  27. $mail->Host = "WEBSITE SAYA"; //host masing2 provider email
  28. $mail->SMTPDebug = 2;
  29. $mail->Port = 465;
  30. $mail->SMTPAuth = true;
  31. $mail->Username = "EMAIL SAYA";
  32. $mail->Password = "PASSWORD SAYA";
  33. $mail->SetFrom("$email","$name"); //kalo disini langsung di isi ("blabla@bla.com","bla"); bisa
  34. $mail->Subject = "contact us";
  35. $mail->AddAddress("info@identalstudio.com","contact us");
  36. $mail->MsgHTML("$message");
  37. if($mail->Send()) echo "Message has been sent";
  38. else echo "Failed to sending message";
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement