$query = $this->db->insert('table_name',$data);
if($query==true)
{
$to = $this->input->post('email');
$subject = "Activation Link";
$message = "<p>Welcome: ".$this->input->post('email')."</p>
<p>Thank you for join InSquareFeet. To activate your account please <a href=".base_url()."thankyou/".$confirm_id."></a></p>";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= "From: ayush@gmail.com";
mail($to,$subject,$message,$headers);
echo '<p>Thank you for connecting with us. We have sent you an activation link on your email id.</p>';
}
else
{
echo '<p>Error!</p>';
}
In this code, I have created a mail function where I insert the form value into the database which is work perfectly but I also want to send the confirmation mail to the candidate which is not working. I don't know why? Where I am doing wrong? Please help me.
Thank You