-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsendmail.php
More file actions
38 lines (37 loc) · 1.06 KB
/
sendmail.php
File metadata and controls
38 lines (37 loc) · 1.06 KB
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
include "link.php";
$str='/brokfree/sendmail.php';
$val=link_check($str);
if($val):
ob_start();
include "templates/error.html";
$out=ob_get_clean();
echo $out;
exit();
endif;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require "classes/PHPMailer.php";
require 'classes/SMTP.php';
require 'classes/Exception.php';
$mail = new PHPMailer();
$mail->isSMTP();
//$mail->SMTPDebug = 2;
$mail->SMTPAuth= true;
$mail->SMTPSecure= 'tls';
$mail->Host ='smtp.gmail.com';
$mail->Port = 587;
$mail->isHTML(true);
$mail->Username =''; //senders mail
$mail->Password =''; //mail password
$mail->setFrom('','BrokFree.com'); //alternate name
$mail->Subject ='BrokFree Account Confirmation';
ob_start();
include "../brokfree/templates/confirmemail.html.php";
$html=ob_get_clean();
$mail->Body = $html;
$mail->addAddress($email); //recievers mail
if(!$mail->send()){
echo 'mailer error '.$mail->ErrorInfo;
}
?>