Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.116.49.143
<?php
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);
function send_mail()
{
require_once "phpmailer/class.phpmailer.php";
$mail = new PHPMailer(); // create a new object
$mail->isSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // 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 = "cuknfc@cuk.ac.in";
$mail->Password = "clab@321";
$mail->SetFrom("cuknfc@cuk.ac.in");
$mail->Subject = "Test";
$mail->Body = "hello";
$mail->AddAddress("arun.v@logisys.org");
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent";
}
}
|