-
Notifications
You must be signed in to change notification settings - Fork 1
/
send-code.php
37 lines (31 loc) · 812 Bytes
/
send-code.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
<?php
use PHPMailer/PHPMailer;
use PHPMailer/Exception;
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
$mail = new PHPMailer;
$mailto=$_POST['mail_to'];
$mailsub=$_POST['mail_sub'];
$mailmsg=$_POST['mail_msg'];
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'selimrezaswadhin@gmail.com';
$mail->Password = '12101989';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->IsHTML(true);
//$mail ->SetFrom("shahin.mm@gmail.com");
$mail ->Subject = $mailsub;
$mail ->Body =$mailmsg ;
$mail ->AddAddress($mailto);
if(!$mail->Send())
{
echo "Mail Not Sent";
}
else
{
echo "Mail Sent";
}
?>