0

This mail function is not working.

In the code below, the $tomail and $frommail parameters are correct, but the mail isn't getting to my Gmail account.

$this->load->library('email');

$config['mailtype'] = 'html';
$config['wordwrap'] = TRUE;

$this->email->initialize($config);
$this->email->to($to);
$this->email->from($from);
$this->email->cc($cc);
$this->email->subject($subject);
$this->email->message($message);
$this->email->send();
if ( ! $this->email->send())
{
    echo $this->email->print_debugger();
mlorbetske
  • 5,529
  • 2
  • 28
  • 40
shine
  • 89
  • 6

1 Answers1

0

Try this one:

$this->load->library('email');
 $config['mailtype'] = 'html';
 $config['protocol'] = 'sendmail';
 $this->email->initialize($config);  
 $this->email->from('yourmailid', 'Admin');
 $this->email->to($email);
 $this->email->subject('hello world');
 $this->email->message($body);

 if($this->email->send()) 
     echo "email send";  
Rakesh Shetty
  • 4,548
  • 7
  • 40
  • 79
  • i tryed but mail not received – shine Jul 30 '12 at 12:19
  • no error get ? $this->email->initialize($config); not receving $config['mailtype'] = 'html'; $config['protocol'] = 'sendmail'; these two paramere in initialize function – shine Jul 31 '12 at 05:49