Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.99 KB | None | 0 0
  1. <?php
  2. date_default_timezone_set("Asia/Jakarta");
  3. require "plugins/phpmailer/class.phpmailer.php";
  4.  
  5. $mail = new PHPMailer;
  6. $mail->IsSMTP(); // telling the class to use SMTP
  7. $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
  8. $mail->SMTPAuth = true; // enable SMTP authentication
  9. $mail->SMTPSecure = "ssl";
  10. $mail->Port = 465; // set the SMTP port for the GMAIL server
  11. $mail->Username = "iqin.nux@gmail.com"; // GMAIL username
  12. $mail->Password = "password"; // GMAIL password
  13.  
  14. $nama = $_POST['nama'];
  15. $no_telepon = $_POST['no_telepon'];
  16. $alamat = $_POST['alamat'];
  17. $email = $_POST['email'];
  18. $pesan = $_POST['pesan'];
  19.  
  20. $messages = $pesan;
  21.  
  22. $mail->SMTPDebug = 1;
  23.  
  24. $mail->From = $email;
  25. $mail->FromName = $nama;
  26. $mail->AddAddress($email, $nama);
  27.  
  28. $mail->Subject = 'Pertanyaan Melalui Website';
  29. $message = '
  30. <table border="0" cellpadding="0" cellspacing="0" style="color:rgb(0,0,0);font-family:Times New Roman;font-size:medium" width="100%">
  31.     <tbody>
  32.         <tr>
  33.             <td style="font-family:arial,sans-serif;margin:0px">
  34.             <table align="center" border="0" cellpadding="0" cellspacing="0" style="border:1px solid rgb(204,204,204)" width="600">
  35.                 <tbody>
  36.                     <tr>
  37.                         <td style="margin:0px;padding:5px 30px">
  38.                         <table width="100%">
  39.                             <tbody>
  40.                                 <tr>
  41.                                     <td style="margin:0px"><img src="http://danautoba.org/wp-content/uploads/2015/03/cropped-cropped-cropped-cropped-logox.png" width="200px" class="CToWUd"></td>
  42.                                 </tr>
  43.                                 <tr>
  44.                                 </tr>
  45.                             </tbody>
  46.                         </table>
  47.                         </td>
  48.                     </tr>
  49.                     <tr>
  50.                         <td bgcolor="#ffffff" style="margin:0px;padding:5px 30px">
  51.                         <table border="0" cellpadding="0" cellspacing="0" width="100%">
  52.                             <tbody>
  53.                                 <tr>
  54.                                     <td style="text-align:justify">Halo <b>'.$nama.' </b>, Terimakasih telah bergabung bersama kami di <b>Komunitas Yayasan Pecinta Danau Toba</b>, untuk pendaftaran member yang anda lakukan akan mendapatkan 1 (satu) poin yang akan di akumulasikan menjadi voucher belanja dan dapat di pergunakan di beberapa merchant yang telah berkerjasama dengan kami.<br><br></td>
  55.                                 </tr>
  56.                                 <tr>
  57.                                     <td>
  58.                                         <table border="0" cellpadding="0" cellspacing="0" style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:medium;line-height:25.600000381469727px" width="100%">
  59.                                             <tbody>
  60.                                                 <tr>
  61.                                                     <td style="font-family:Arial,sans-serif;margin:0px;padding:20px 0px 30px;color:rgb(88,88,90);font-size:16px;line-height:20px;text-align:justify">
  62.                                                         Untuk mendapatkan nomor dan kartu keanggotaan <strong>Komunistas Sahabat Danau Toba</strong> dan bisa menggunakan fitur-fitur di website <a href="http://danautoba.org">danautoba.org</a> silahkan login untuk melengkapi foto profil serta biodata diri anda dengan informasi data yang sebenar-benarnya. Lengkapi biodata diri Anda <a href="http://danautoba.org/memberarea/check-login.php?u='.$email.'"><button>
  63.                                                         DISINI
  64.                                                         </button></a>
  65.                                                     </td>
  66.                                                 </tr>
  67.                                             </tbody>
  68.                                         </table>
  69.                                     </td>
  70.                                 </tr>
  71.                             </tbody>
  72.                         </table>
  73.                         </td>
  74.                     </tr>
  75.                     <tr>
  76.                         <td bgcolor="#f0f0f0" style="font-family:Open Sans,Arial,sans-serif;margin:0px;padding:10px 30px;line-height:23px"><b style="color:rgb(88,88,90)">INFO LEBIH LANJUT:</b><br>
  77.                         <font style="font-size:16px;color:rgb(88,88,90)"><a href="http://danautoba.org" style="color:rgb(17,85,204)" target="_blank">http://danautoba.org</a><br>
  78.                         <b><a href="https://www.facebook.com/yayasanpencintadanautoba" style="color:rgb(17,85,204)" target="_blank">Facebook</a></b>&nbsp;atau&nbsp;<b><a href="mailto:admin@danautoba.org" target="_top">admin@danautoba.org</a></b></font></td>
  79.                     </tr>
  80.                 </tbody>
  81.             </table>
  82.             </td>
  83.         </tr>
  84.     </tbody>
  85. </table>
  86. ';
  87. $mail->Body = $message;
  88. $mail->IsHTML(true);
  89. if(!$mail->Send()) {
  90.    echo 'Message could not be sent.';
  91.    echo 'Mailer Error: ' . $mail->ErrorInfo;
  92.    exit;
  93. }else {
  94.    header('location:index.php');
  95. }
  96.  
  97. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement