Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "****";
- $username = "*****";
- $password = "****";
- $dbname = "****";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT name, COUNT(current_task_id) FROM apps_progress WHERE current_task_id = 3 GROUP BY name LIMIT 0, 30 ";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- include('PHPMailer-master/class.phpmailer.php');
- $mail = new PHPMailer();
- //$mail->IsSMTP(); // telling the class to use SMTP
- //$mail->Host = "localhost"; // SMTP server
- //IsSMTP(); // send via SMTP
- $mail->Host = "*********"; // SMTP server Gmail
- $mail->port = 143;
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "**********"; //
- $mail->Password = "********"; // SMTP password
- $webmaster_email = "************"; //Reply to this email ID
- $email = "fredysetiawan1992@gmail.com"; // Recipients email ID
- $name = "namapenerima"; // Recipient's name
- $mail->From = $webmaster_email;
- $mail->FromName = "fredy";
- $mail->AddAddress($email,$name);
- $mail->AddReplyTo($webmaster_email,"paidi");
- $mail->IsHTML(true); // send as HTML
- $mail->Subject = "Ini adalah Email HTML";
- $mail->Body = "<p>jumlahnya "echo $row[1]"</p> "; //HTML Body
- if(!$mail->Send())
- {
- echo "Mailer Error: " . $mail->ErrorInfo;
- }
- else
- {
- echo "Message has been sent";
- }
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement