<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
//$this->load->view('welcome_message');
$this->load->library('email');
$this->email->initialize(array(
'protocol' => 'smtp',
'smtp_host' => 'your mail host',
'smtp_user' => 'your mail id',
'smtp_pass' => 'your mail password',
'smtp_port' => port id,
'crlf' => "\r\n",
'newline' => "\r\n"
));
$this->email->from('from mail id', 'Prasanna');
$this->email->to('to mail id');
//$this->email->cc('[email protected]');
//$this->email->bcc('[email protected]');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$status = $this->email->send();
if($status =='1'){
echo "Success";
}
}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
Добро пожаловать на Stack Overflow. Это не очень хороший способ задать вопрос здесь. Вы что-то пытались решить, чтобы решить вашу проблему? Покажите свои усилия, чтобы люди могли показать их. Пожалуйста, прочитайте [FAQ] (http://stackoverflow.com/tour), [Как спросить] (http://stackoverflow.com/help/how-to-ask) и [справочный центр] (http: // stackoverflow .com/help) как начало. –