Hello guys I am trying to send the mail after user fills in the registration form and clicks the submit button. i have no clue what am i doing wrong but i dont receive any mails. Please help me!
<?php
if(isset($_POST['submit']))
{
$message=
'Name : ' .$_POST['firstname'].' <br />
';
require "phpmailer/class.phpmailer.php"; //include phpmailer class
// Instantiate Class
$mail = new PHPMailer();
// Set up SMTP
$mail->IsSMTP(); // Sets up a SMTP connection
$mail->SMTPAuth = true; // Connection with the SMTP does require authorization
$mail->SMTPSecure = "ssl"; // Connect using a TLS connection
$mail->Host = "smtp.gmail.com"; //Gmail SMTP server address
$mail->Port = 465; //Gmail SMTP port
$mail->Encoding = '7bit';
// Authentication
$mail->Username = "holla@gmail.com"; // Your full Gmail address
$mail->Password = "blablabla"; // Your Gmail password
// Compose
$mail->Subject = "New Admission Enquiry Form"; // Subject (which isn't required)
$mail->MsgHTML($message);
// Send To
$mail->AddAddress("jaganrao44@gmail.com", "Recipient Name"); // Where to send it - Recipient
$result = $mail->Send(); // Send!
$message = $result ? 'Successfully Sent!' : 'Sending Failed!';
}
?>