-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmailfunction.php
More file actions
39 lines (28 loc) · 870 Bytes
/
mailfunction.php
File metadata and controls
39 lines (28 loc) · 870 Bytes
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
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'plugin/PHPMailer/src/Exception.php';
require 'plugin/PHPMailer/src/PHPMailer.php';
require 'plugin/PHPMailer/src/SMTP.php';
$mail= new PHPMailer(true);
$mail->isSMTP();
$mail->Host='smtp.gmail.com';
$mail->SMTPAuth=true;
$mail->SMTPSecure='tls';
$mail->Port=587;
$mail->Username = 'ayankamila005@gmail.com';
$mail->Password = 'hkgw xtxz qhgz xktx';
$mail->setFrom('ayankamila005@gmail.com','Clickbase E-Commerce');
$mail->addAddress('swagatamanna699@gmail.com','Swagata Manna');
$mail->isHTML(true);
$mail->CharSet='UTF-8';
$mail->Subject='Clickbase E-commerce Registration';
$mail->Body="<h1>Hi Swagata Manna,<br/> Welcome to Clickbase E-commerce.";
$mail->send();
if(!$mail->send()){
echo $mail->ErrorInfo;
}
else{
echo "Successfully Send the Mail.";
}
?>