Advertisement
Guest User

email

a guest
Aug 19th, 2016
166
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. require 'phpmailer/PHPMailerAutoload.php';
  3. $email = 'mingkengdota@gmail.com';     //EMAIL YANG DIPAKE KIRIM EMAIL              
  4. $password = 'mingkeng007';             //PASSWORD EMAIL
  5. $to_id = $_POST["email"];              //EMAIL TUJUAN
  6. $message = $_POST["message"];          //ISI PESAN
  7. $subject = '[Website Form] Eternal Organizer'; //SUBJECT EMAIL
  8.  
  9. /* DI DISABLE
  10. $name = $_POST["name"];
  11. $email = $_POST["email"];
  12. $message = $_POST["message"];
  13. $Body = $_POST["Body"];
  14. */
  15. $mail = new PHPMailer;
  16. $mail->isSMTP();
  17.  
  18. $mail->Host = 'smtp.gmail.com';
  19. $mail->Port = 587;
  20.  
  21. $mail->SMTPSecure = 'tls';
  22.  
  23. $mail->SMTPAuth = true;
  24.  
  25. $mail->Username = $email;
  26.  
  27. $mail->Password = $password;
  28.  
  29. $mail->setFrom('from@example.com', 'First Last');
  30.  
  31. $mail->addReplyTo('replyto@example.com', 'First Last');
  32.  
  33. $mail->addAddress($to_id);
  34.  
  35. $mail->Subject = $subject;
  36.  
  37. $mail->msgHTML($message);
  38.  
  39. if (!$mail->send()) {
  40.     $error = "Mailer Error: " . $mail->ErrorInfo;
  41.         echo $error;
  42. }
  43. else {
  44.     echo "sukses";
  45. }
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement