-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend.php
40 lines (34 loc) · 825 Bytes
/
send.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
39
40
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'Exception.php';
require 'PHPMailer.php';
require 'SMTP.php';
function sendOTP($otp,$email){
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Host = 'localhost';
$mail->Port = 25;
$mail->SMTPAuth = false;
$mail->smtpConnect([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
]);
$mail->Username = 'help@muse-at.com';
$mail->Password = 'mail@museat';
$mail->setFrom('help@muse-at.com');
$mail->addReplyTo('help@muse-at.com');
$mail->addAddress($email);
$mail->Subject = 'muse-at';
$mail->Body = "Your OTP is $otp.";
if (!$mail->send()) {
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'The email message was sent.';
}
}
?>