Below is my function in controller where I included phpmailer/PHPMailerAutoload.php But when I comment $mail = new PHPMailer this i dont get any error.
Help me Please!
function register_user() {
$company_name = $this->input->post('company_name');
$name = $this->input->post('name');
$gstn_number = $this->input->post('gstn_number');
$mobile = $this->input->post('mobile');
$email = $this->input->post('email');
$password = $this->input->post('password');
if (isset($_POST["register"])) {
$status = $this->common_model->executeNonQuery("INSERT INTO `temp_register`(`company_name`,`name`,`gstn_number`,`mobile`,`email`,`password`) VALUES ('$company_name','$name','$gstn_number','$mobile','$email','$password')");
if ($status) {
$mail = new PHPMailer;
$mail->SMTPDebug = 3;
$mail->setFrom($email, 'example');
$mail->addAddress($mail_to, 'ac');
$mail->Subject = 'Request Approval Sent From User';
$mail->Body = "Please Approve My Request!";
$mail->send();
echo "<script>
alert('You have successfully requested for registration! You will be notified when request is approved, Thanks!');
window.location.href='some_location';
</script>";
} else {
echo "<script>
alert('Problem While Requesting Please Try Again!');
window.location.href=''location';
</script>";
}
}
}