-
Notifications
You must be signed in to change notification settings - Fork 0
/
tes.php
38 lines (34 loc) · 1.22 KB
/
tes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require 'vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
function kirimEmail($email,$limit,$total){
$mail = new PHPMailer(true);
try {
$mail->SMTPDebug = 1;
$mail->isSMTP();
$mail->Host = 'novara.id.domainesia.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'eAGTGqQzpXrM';
$mail->SMTPSecure = 'tsl';
$mail->Port = 25;
$mail->setFrom('[email protected]', 'DosaKu');
$mail->addAddress($email);
$mail->isHTML(true);
$mail->Subject = 'Peringatan Limit Pengeluaran';
$mail->Body = 'Limit pengeluaran kamu sudah melebihi batas yang telah ditentukan.<br>
<b>Limit Pengeluaran : </b> Rp. '.number_format($limit,0,',','.').',-<br>
<b>Total Pengeluaran : </b> Rp. '.number_format($total,0,',','.').',-';
$mail->send();
return true;
} catch (Exception $e) {
return false;
}
}
if(kirimEmail('[email protected]',1000000,2000000)){
echo 'berhasil';
}else{
echo 'gagal';
}