I have the following to send an email
if($this->form_validation->run())
{
$data = $this->input->post();
$this->load->library('email');
$this->email->from('[email protected]', 'Joe Dev');
$this->email->reply_to('[email protected]', 'Joe Dev');
$this->email->to('[email protected]');
$this->email->cc('[email protected]');
$this->email->subject('Email Test');
$this->email->message('I used this firstname: '. $data['fname']);
$this->email->send();
$config['charset'] = 'iso-8859-1';
$config['smtp_host'] = 'mail.google.com';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'mypassword';
$this->email->initialize($config);
}
where $this->email->to() is my webmail account, it delivers the message successfully but it has failed for every gmail account I tried sending it to. What may be the problem?