Codeigniter Email

Step 1
php.ini>uncomment opsenssl

Step 2
In email controller,
function email(){
$config[‘protocol’] = ‘smtp’;
$config[‘smtp_host’] = ‘ssl://smtp.googlemail.com’;
$config[‘smtp_port’] = 465;
$config[‘smtp_user’] = ‘miss.sumyatnoepwint@gmail.com’;
$config[‘smtp_pass’] = ‘chochowintintun’;
$this->load->library(’email’, $config);
$this->email->set_newline(“\r\n”);
$this->email->from(‘miss.sumyatnoepwint@gmail.com’, ‘Su Myat’);
$this->email->to(‘sumyat@a.com’);
$this->email->subject(‘This is an email test’);
$this->email->message(‘It is working. Great!’);
if($this->email->send())
{
echo ‘Your email was sent, successfully.’;
}

else
{
show_error($this->email->print_debugger());
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s