Current File : /home/inlingua/public_html/icentex/conveyance/testemail.php
<?php

require("../class.phpmailer.php");
$mail = new PHPMailer;

//Enable SMTP debugging.
$mail->SMTPDebug = 2;                               
//Set PHPmailer to use SMTP.
$mail->isSMTP();            
//Set SMTP host name                          
$mail->Host = "mail.inlinguanewdelhi.in";
//Set this to true if SMTP host requires authentication to send email
$mail->SMTPAuth = true;                          
//Provide username and password  
//$mail->Priority = 1;
$domain = "inlinguanewdelhi.in";

		    $smtpHost = "mail.$domain";

		    $smtpUser = "admin@$domain";

		    $smtpPassword = "5B&vp7pgm7flABvi";

$path='rpts/Amod_Kumar_03_2021_conveyance.pdf';
$link='https://inlinguanewdelhi.in/icentex/conveyance/rpts/Amod_Kumar_03_2021_conveyance.pdf';
$message="Hi abdul".",<br>A new Conveyance Sheet has been submitted by you.";


$message.="The details are as follows:<br>Month: ".'TEST'."<br>Year: ".'2021'."<br><br>";

$message.="*If the details in the conveyance sheet are incorrect or you wish to make any changes, please contact the Administrator at hrd@inlinguanewdelhi.com";

$message.="<a href=".$link.">Download Conveyance Sheet</a>";

echo $message; 
$to="abdullahansari70@gmail.com";
$fullname="ABDUL";
$subject="ATTACHMENT";
$mail->Username = $smtpUser;                 
$mail->Password = $smtpPassword;                           
//If SMTP requires TLS encryption then set it
//$mail->SMTPSecure = "tls";                           
//Set TCP port to connect to 465
//$mail->Port = 587;                                   
	
	
$mail->From = "admin@inlinguanewdelhi.in";
$mail->FromName = "Admin inlinguanewdelhi";
$mail->addAddress($to, $fullname);
//$pdf->Output("Test Invoice.pdf","F");
//$mail->AddAttachment($path,basename($path));
//$mail->AddAttachment($path);
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AltBody = "";
if (!$mail->send()) 
	{
		echo  "Message could not be sent on mailsid: <font color='red'>'".$toAddress."'";
		echo 'mailser Error: '. $mails->ErrorInfo;
		exit;
    } else {
echo 'emails Send !!!';
	}	

?>