-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend.php
36 lines (29 loc) · 898 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
<?php
use PHPMailer\PHPMailer\PHPMailer;
require 'src/mailer/Exception.php';
require 'src/mailer/SMTP.php';
require 'src/mailer/PHPMailer.php';
$mail = new PHPMailer();
try {
$msg = "ok";
$mail->isSMTP();
$mail->CharSet = "UTF-8";
$mail->SMTPAuth = true;
// Your mail settings
$mail->Host = 'smtp.gmail.com';
$mail->Username = 'your email';
$mail->Password = 'your password';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->setFrom('your email', 'Helper'); // Recipient mail address and sender name
// Message recipient
$mail->addAddress('your email');
$mail->isHTML(true);
$mail->Subject = 'The result of registration on the site';
$mail->Body = "<b><p>Registration completed successfully!</p></b>";
if ($mail->send()) {
echo $msg;
}
} catch (Exception $ex) {
echo "Send error: {$mail->ErrorInfo}";
}