mfnurfauzi19

email.php

Aug 25th, 2019
2,362
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div class="col-md-10 p-5 pt-2">
  2. <h3><i class="fas fa-mail-bulk mr-2"></i>Reminder E-mail</h3><hr>
  3.  
  4. <!-- Konfigurasi PHP Mailer -->
  5. <?php
  6. require_once('assets/PHPMailer/src/PHPMailer.php');
  7. require_once('assets/PHPMailer/src/SMTP.php');
  8. require_once('assets/PHPMailer/src/Exception.php');
  9.  
  10. $mail = new PHPMailer\PHPMailer\PHPMailer();
  11. $mail->IsSMTP();
  12. $mail->IsHTML(true);
  13. $mail->SMTPAuth = true;
  14. $mail->Host = "srv23.niagahoster.com";
  15. $mail->Port = 465;
  16. $mail->SMTPSecure = "ssl";
  17. $mail->Username = "**********@inovindo.co.id"; //username SMTP
  18. $mail->Password = "********************"; //Password SMTP
  19. $mail->From = "***********@inovindo.co.id"; //E-mail pengirim
  20. $mail->FromName = "Customer Care Inovindo Digital Media"; //nama pengirim
  21. ?>
  22.  
  23.  
  24. <!-- Card Broadcast Promo -->
  25. <div>
  26. <div class="card border-primary mb-3">
  27. <h5 class="card-header bg-primary text-white"><center>Broadcast Promo</center></h5>
  28. <div class="card-body">
  29. <form action="" method="post" name="form_broadcast">
  30. <label for=""><h5>Masukan Isi Subject</h5></label>
  31. <input type="text" id="subject" class="fadeIn third" name="subject" placeholder="Masukan Subject"><hr><br>
  32. <label for="" id="isipesanbroadcast"><h5>Masukan Isi Pesan</h5></label>
  33. <textarea type="text" name="textarea_pesan" id="" cols="10" rows="3" placeholder="Masukan Pesan"></textarea>
  34. <br>
  35. <button type="submit" class="btn btn-success btn-lg btn-block" name="kirimBroadcast">Kirim</button>
  36. </form>
  37. </div>
  38. </div>
  39. <?php
  40. // Pengiriman Broadcast
  41. if (isset($_POST["kirimBroadcast"])){
  42. // foreach($data_client as $email) :
  43. $mail->AddAddress ($data_client['email']); //E-mail dan nama penerima atau tujuan
  44. $mail->Subject = $_POST['subject']; //Judul E-mail
  45. $mail->Body = $_POST['textarea_pesan']; //Isi Pesan
  46. // $mail->AddAttachment(base_url().('assets/img/logoinovindo.png'),"Logo Inovindo"); //Nama file dengan formatnya dan diganti dengan nama Logo Inovindo
  47. // endforeach;
  48. if ($mail->Send()) {
  49. ?>
  50. <div class="alert alert-warning" role="alert">
  51. Pesan berhasil terkirim!
  52. </div>
  53. <?php //Jika pesan terkirim
  54. }else {
  55. ?>
  56. <div class="alert alert-danger" role="alert">
  57. Pesan Gagal Terkirim!
  58. </div>
  59. <?php //Jika pesan terkirim
  60. }
  61. }
  62. // endforeach;
  63. ?>
  64. </div>
  65.  
  66. <!-- Card Selamat Ulang Tahun -->
  67. <div>
  68. <div class="card border-primary">
  69. <h5 class="card-header bg-primary text-white"><center>Selamat Ulang Tahun</center></h5>
  70. <div class="card-body ">
  71. <h5 class="card-title">Format</h5><hr>
  72. <p class="card-text">Kami Dari Keluarga Besar PT.Inovindo Digital Media Mengucapkan Selamat Ulang Tahun</p>
  73. </div>
  74. </div>
  75. </div>
  76.  
  77.  
  78.  
  79.  
  80.  
  81. <?php
  82. //Pengiriman Terjadwal (Ulang Tahun)
  83.  
  84. ?>
  85.  
  86. </div>
RAW Paste Data