0
votes

i am getting fed up with the godaddy and their lack of knowledge or solutions to get my email working properly. So maybe someone on stackoverflow has a solution to the issue.

I am unable to get my email working in codeigniter with a secure ssl connection.

The not secure solution works

$config['email_config'] = [
    'email_address' => '[email protected]',
    'owner'         => 'Owner',
    'email_owner'   => '[email protected]',
    'charset'       => 'utf-8',
    'mailtype'      => 'html',
    'protocol'      => 'smtp',
    'smtp_host'     => 'mail.domain.com',
    'smtp_port'     => '587', // 465, 25, 587
    'smtp_timeout'  => '7',
    'smtp_user'     => '[email protected]',
    'smtp_pass'     => 'xxx',
    'validation'    => TRUE, 
];

But i can not seem to get a ssl connected email going.

$config['email_config'] = [
    'email_address' => '[email protected]',
    'owner'         => 'Owner',
    'email_owner'   => '[email protected]',
    'charset'       => 'utf-8',
    'mailtype'      => 'html',
    'protocol'      => 'smtp',
    'smtp_host'     => 'domain.com',
    'smtp_crypto'   => 'ssl',
    'smtp_port'     => '465', // 465, 25, 587
    'smtp_timeout'  => '7',
    'smtp_user'     => '[email protected]',
    'smtp_pass'     => 'xxx',
    'validation'    => TRUE, 
];

Details provided in the mail of my cpanel

  • Secure SSL/TLS Settings (Recommended)
  • Username: [email protected]
  • Password: Use the email account’s password.
  • Incoming Server: domain.com
  • IMAP Port: 993 POP3 Port: 995
  • Outgoing Server: domain.com
  • SMTP Port: 465
  • IMAP, POP3, and SMTP require authentication.
1

1 Answers

-1
votes

if you are passing $config to email class of codeigniter, use something like this

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'host.host.com';
$config['smtp_user'] = 'username';
$config['smtp_pass'] = 'pass';
$config['smtp_crypto'] = 'tls';
$config['smtp_port'] = 587;

$config['charset'] = 'utf-8';
$config['mailtype'] = 'html';
$config['newline'] = "\r\n"; 

then pass $config to method

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

if does not work chnange [smtp_crypto] to ssl and port to 465

EDIT: this for codeigniter 3, code 4.0.0 its differently done, tell me in reply