Advertisement
Guest User

Untitled

a guest
May 16th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.71 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3.  
  4. $html = '
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  6. <html lang="en">
  7. <head>
  8.  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  9.  <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- So that mobile will display zoomed in -->
  10.  <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- enable media queries for windows phone 8 -->
  11.  <meta name="format-detection" content="telephone=no"> <!-- disable auto telephone linking in iOS -->
  12.  <title>Single Column</title>
  13.  
  14.  <style type="text/css">
  15. body {
  16.  margin: 0;
  17.  padding: 0;
  18.  -ms-text-size-adjust: 100%;
  19.  -webkit-text-size-adjust: 100%;
  20. }
  21.  
  22. table {
  23.  border-spacing: 0;
  24. }
  25.  
  26. table td {
  27.  border-collapse: collapse;
  28. }
  29.  
  30. .ExternalClass {
  31.  width: 100%;
  32. }
  33.  
  34. .ExternalClass,
  35. .ExternalClass p,
  36. .ExternalClass span,
  37. .ExternalClass font,
  38. .ExternalClass td,
  39. .ExternalClass div {
  40.  line-height: 100%;
  41. }
  42.  
  43. .ReadMsgBody {
  44.  width: 100%;
  45.  background-color: #ebebeb;
  46. }
  47.  
  48. table {
  49.  mso-table-lspace: 0pt;
  50.  mso-table-rspace: 0pt;
  51. }
  52.  
  53. img {
  54.  -ms-interpolation-mode: bicubic;
  55. }
  56.  
  57. .yshortcuts a {
  58.  border-bottom: none !important;
  59. }
  60.  
  61. @media screen and (max-width: 599px) {
  62.  .force-row,
  63.  .container {
  64.    width: 100% !important;
  65.    max-width: 100% !important;
  66.  }
  67. }
  68. @media screen and (max-width: 400px) {
  69.  .container-padding {
  70.    padding-left: 12px !important;
  71.    padding-right: 12px !important;
  72.  }
  73. }
  74. .ios-footer a {
  75.  color: #aaaaaa !important;
  76.  text-decoration: underline;
  77. }
  78. </style>
  79. </head>
  80.  
  81. <body style="margin:0; padding:0;" bgcolor="#F0F0F0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  82.  
  83. <!-- 100% background wrapper (grey background) -->
  84. <table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0" bgcolor="#F0F0F0">
  85.  <tr>
  86.    <td align="center" valign="top" bgcolor="#F0F0F0" style="background-color: #F0F0F0;">
  87.  
  88.      <br>
  89.      <!-- 600px container (white background) -->
  90.      <table border="0" width="600" cellpadding="0" cellspacing="0" class="container" style="width:600px;max-width:600px">
  91.        <tr>
  92.          <td class="container-padding header" align="left" style="font-family:Helvetica, Arial, sans-serif;font-size:24px;font-weight:bold;padding-bottom:12px;color:#DF4726;padding-left:24px;padding-right:24px">
  93.            &nbsp;
  94.          </td>
  95.        </tr>
  96.        <tr>
  97.          <td class="container-padding content" align="left" style="padding-left:24px;padding-right:24px;padding-top:12px;padding-bottom:12px;background-color:#ffffff">
  98.            <br>
  99.  
  100. <div class="title" style="font-family:Helvetica, Arial, sans-serif;font-size:18px;font-weight:600;color:#374550">RESET YOUR PASSWORD</div>
  101. <br>
  102.  
  103. <div class="body-text" style="font-family:Helvetica, Arial, sans-serif;font-size:14px;line-height:20px;text-align:left;color:#333333">
  104.  
  105.  Hi '.$row[1].',
  106.  We were told that you forgot your password on Boneka Shop.<br>
  107.    '.$row[1].'
  108.  <br><br>
  109.  Thanks,<br>
  110.  Intive Studio.
  111.  <br><br>
  112. </div>
  113.  
  114.          </td>
  115.        </tr>
  116.        <tr>
  117.          <td class="container-padding footer-text" align="left" style="font-family:Helvetica, Arial, sans-serif;font-size:12px;line-height:16px;color:#aaaaaa;padding-left:24px;padding-right:24px">
  118.            <br><br>
  119.            <br><br>
  120.  
  121.            <br>
  122.            <br><br>
  123.  
  124.          </td>
  125.        </tr>
  126.      </table>
  127.    </td>
  128.  </tr>
  129. </table>
  130. </body>
  131. </html>
  132. ';
  133. /**
  134.  * This example shows settings to use when sending via Google's Gmail servers.
  135.  */
  136.  
  137. //SMTP needs accurate times, and the PHP time zone MUST be set
  138. //This should be done in your php.ini, but this is how to do it if you don't have access to that
  139. date_default_timezone_set('Etc/UTC');
  140.  
  141. require '../assets/phpmailer/PHPMailerAutoload.php';
  142.  
  143.  
  144. //Create a new PHPMailer instance
  145. $mail = new PHPMailer;
  146.  
  147. //Tell PHPMailer to use SMTP
  148. $mail->isSMTP();
  149.  
  150. //Enable SMTP debugging
  151. // 0 = off (for production use)
  152. // 1 = client messages
  153. // 2 = client and server messages
  154. $mail->SMTPDebug = 0;
  155.  
  156. //Ask for HTML-friendly debug output
  157. $mail->Debugoutput = 'html';
  158.  
  159. //Set the hostname of the mail server
  160. $mail->Host = 'smtp.gmail.com';
  161.  
  162. //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
  163. $mail->Port = 587;
  164.  
  165. //Set the encryption system to use - ssl (deprecated) or tls
  166. $mail->SMTPSecure = 'tls';
  167.  
  168. //Whether to use SMTP authentication
  169. $mail->SMTPAuth = true;
  170.  
  171. //Username to use for SMTP authentication - use full email address for gmail
  172. $mail->Username = "intives@gmail.com";
  173.  
  174. //Password to use for SMTP authentication
  175. $mail->Password = "krisna23";
  176.  
  177. //Set who the message is to be sent from
  178. $mail->setFrom('werkudara94@gmail.com', 'RESET YOUR PASSWORD');
  179.  
  180. //Set an alternative reply-to address
  181. $mail->addReplyTo("sea_todo2016@gmail.com", 'RESET YOUR PASSWORD');
  182.  
  183. //Set who the message is to be sent to
  184. $mail->addAddress("$lol", "$row[1]");
  185.  
  186. //Set the subject line
  187. $mail->Subject = 'New To Do';
  188.  
  189. //Read an HTML message body from an external file, convert referenced images to embedded,
  190. //convert HTML into a basic plain-text alternative body
  191. //$mail->msgHTML("$html");
  192. $mail->isHTML(true);
  193. $mail->Body = $html;
  194.  
  195. //Replace the plain text body with one created manually
  196. //$mail->AltBody = 'This is a plain-text message body';
  197.  
  198. //Attach an image file
  199. //$mail->addAttachment('images/phpmailer_mini.png');
  200.  
  201. //send the message, check for errors
  202.   if (!$mail->send()) {
  203.  
  204.   echo "<script>alert('Kami akan mengirimkan alamat untuk reset password ke email anda ".$row[0].".'); window.location='index.php'</script>";
  205.  
  206.   } else {
  207.       echo "<script>window.location='index.php'</script>";
  208.   }
  209. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement