CodeIgniter SMTP Integration Guide

Guide to integrate Mailazy with your CodeIgniter application


Prerequisites

You need to complete these given prerequisites, you can skip the step if you have already completed.

  1. Sign up for a Mailazy account.
  2. Complete Domain Authentication.
  3. Generate the Mailazy Access Key

Integrate Mailazy with CodeIgniter

CodeIgniter comes with an email sending library built in. It is important to use the correct end of lines using "crlf" => "\r\n" and "newline" => "\r\n".

<?php
$this->load->library('email');
$this->email->initialize(array(
  'protocol' => 'smtp',
  'smtp_host' => 'smtp.mailazy.com',
  'smtp_user' => 'access_key',
  'smtp_pass' => 'access_secret',
  'smtp_port' =>  587,
  'crlf' => "\r\n",
  'newline' => "\r\n"
));

$this->email->from('your@example.com', 'Your Name');
$this->email->to('someoneexampexample@example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo  $this->email->print_debugger();
?>