forked from ABHRADEEP800/PHP-E_Commerce_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmtp.php
22 lines (17 loc) · 893 Bytes
/
smtp.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
require('PHPMailer/src/PHPMailer.php');
require('PHPMailer/src/SMTP.php');
//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer\PHPMailer\PHPMailer(true);
//Server settings
//Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp.demohost.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'user@username.com'; //SMTP username
$mail->Password = 'password'; //SMTP password
$mail->SMTPSecure = 'ssl'; //Enable implicit TLS encryption
$mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
//Recipients
$mail->setFrom('user@username.com', 'User');
?>