Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?Php
- require("PHPMailer_5.2.4/class.smtp.php");
- require("PHPMailer_5.2.4/class.phpmailer.php");
- $mail = new PHPMailer();
- $mail->IsSMTP(); // telling the class to use SMTP
- $mail->SMTPDebug = 1;
- $mail->SMTPAuth = TRUE;
- $mail->SMTPSecure = "SSL";
- $mail->Host = "smtp.gmail.com"; // SMTP server
- $mail->Port = "465";
- $mail->IsHTML(true) ;
- $mail->Username = "dia.ajah@gmail.com";
- $mail->Password = "rahasia";
- $mail->setFrom("dia.ajah@gmail.com");
- $subject = "Laporan Absen";
- $mail->Subject = $subject;
- $message = 'Terlampir Adalah Data Laporan Absen '.date('d-M-Y H:i');
- $message .= '<br><br><br>' ;
- $message .= 'Best Regards,<br>';
- $message .= 'Absensi Sistem <br>';
- $message .= '(Data ini diproses dan dikirim oleh system secara otomatis)';
- $mail->Body = $message;
- $to = "aku.ajah@balrich.co.id";
- $mail->AddAddress($to);
- //$mail->Send();
- if(!$mail->Send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message sent!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement