0

I am beginner with codeiginter and I am not understanding how to send email. Please anyone can help? Thanks in advance.

$config = Array(
                'mailtype'  => 'html', 
                );
              $this->load->library('email', $config);
              $this->email->set_newline("\r\n");
              $this->email->from('aaa@gmail.com', 'aaa');
              $this->email->to('bbb@gmail.com');  
              $this->email->subject('This is an email test');  
              $this->email->message('It is working. Great!');
              $result = $this->email->send();
              echo $this->email->print_debugger();
Brian
  • 1,184
  • 2
  • 21
  • 38
wordpress
  • 13
  • 3

2 Answers2

1
$this->email->initialize($config);
$this->email->from($from);
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($mailContent);
($this->email->send())  
shubomb
  • 672
  • 7
  • 20
0
$this->load->library('email');

$this->email->from('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');

$this->email->subject('Email Test');
$this->email->message('Testing the email class.');

$this->email->send();

echo $this->email->print_debugger();

refrence #Codeigniter Email

Azam Alvi
  • 6,918
  • 8
  • 62
  • 89