CodeIgniter Email Configuration

I was debugging an issue with sending email with PHP CodeIgniter and found this interesting. Strange enough the issue was not setting the charset.

Below setting worked for me

<?php defined('BASEPATH') OR exit('No direct script access allowed');

$config['protocol'] = 'smtp', // 'mail', 'sendmail', or 'smtp'
$config['smtp_host'] = '', 
$config['smtp_port'] = 465,
$config['smtp_user'] = '',
$config['smtp_pass'] = '12345!',
$config['smtp_crypto'] = 'tls', //can be 'ssl' or 'tls' for example
$config['mailtype'] = 'text', //plaintext 'text' mails or 'html'
$config['smtp_timeout'] = '4', //in seconds
$config['charset'] = 'iso-8859-1',
$config['wordwrap'] = TRUE

On a side note, its interesting how to debug PHP application with VS Code and XDebug. If anyone interested this could be a great starting point ->


About buminda
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

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

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

Facebook photo

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

Connecting to %s