I have a droplet on digital ocean which runs the LAMP server on digital ocean . I have hosted a site created in codeigniter on the digital ocean. I want to send email containing data from the forms on the site to my own email address. But some how the output for the code says data is showing 'sent' not a single email is being received in my gmail account . I have implemented same code on c-panel hosting but digitalocean is creating hurdles for me .
This is the code i have used to send email:
public function email()
{
$from_email = "from@gmail.com";
$to_email = $this->input->post('to@gmail.com');
//Load email library
$this->load->library('email');
$this->email->from($from_email, 'Parwati Hills');
$this->email->to($to_email);
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
//Send mail
if($this->email->send()) {
print_r("Sent");
}
else {
print_r("Not Sent");
}
}
The Link used for testing: https://parwatihills.com/index.php/Welcome/email
Output shows : Sent , But Email is not received. I have checked spam folder also. Help Needed.