PHP Send mail use localhost

PHP Send mail Use Localhost Bangla Tutorial


<?php

$mailto='sahin.mj@gmail.com';
require 'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;

$mail->isSMTP();                           
$mail->Host = 'smtp.gmail.com';           
$mail->SMTPAuth = true;                    
$mail->Username = 'example@gmail.com';         
$mail->Password = 'emailpasssword';
$mail->SMTPSecure = 'tls';              
$mail->Port = 587; 
 $mail ->SetFrom("shahin.mm@gmail.com");
 $mail ->Subject = 'mail';
   $mail ->Body ='makkkk' ;
   $mail ->AddAddress($mailto);

   if(!$mail->Send())
   {
       echo "Mail Not Sent";
   }
   else
   {
       echo "Mail Sent";
   }

?>
 I am very for mistake how to less security your email account..Please Follow this step:
Email account less security  link: https://myaccount.google.com/lesssecureapps?pli=1



Download php mailer: https://drive.google.com/open?id=1sScv32YirOEzw-vF17UvAdho_RyyajG5

No comments

Powered by Blogger.