I want to know how to send mail in php. I have tried the php mailer but it doesn't work. Can we send email from local host?
<?php
require_once 'class.phpmailer.php';
$mailer = new PHPMailer();
$mailer->CharSet = 'utf-8';
$mailer->AddAddress("gkpmanu@gmail@gmail.com");
$mailer->Subject = "Student Registration";
$mailer->From = "coursereg@gmail.com";
$mailer->FromName = "course registration system";
// $mailer->AddBCC("nitcoursereg@gmail.com", "Registeration");
$mailer->Body ="You have registered";
if($mailer->Send()){
echo "Sent";
}
else
echo 'Mailer Error: ' . $mail->ErrorInfo;
echo "Not Sent";
?>