-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestmail.php
More file actions
35 lines (28 loc) · 977 Bytes
/
testmail.php
File metadata and controls
35 lines (28 loc) · 977 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
<?php
require 'vendor/autoload.php';
//sandeep kumar dewangan
use PHPMailer\PHPMailer\PHPMailer;
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 2; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
$mail->Host = "smtp.gmail.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->Username = "webadmin@vnrseeds.com";
$mail->Password = "gfch ixci diqb qqcw";
$mail->SetFrom("webadmin@vnrseeds.com");
// $mail->Username = "recruitment@vnrseeds.com";
// $mail->Password = "Vnr;24680#Dev@H";
// $mail->SetFrom("recruitment@vnrseeds.com");
$mail->Subject = "Test";
$mail->Body = "hello";
$mail->AddAddress("sandeepdewangan2012@gmail.com");
$mail->Send();
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent";
}
?>