Skip to content
Simple "Mailgun" library for Code Igniter. No library required. One file
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/libraries
README.md

README.md

Simple Mailgun for code igniter 3

Simple "Mailgun" library for Code Igniter. No library required.

Features

  • Small (~ 2KB)
  • No additional library required
  • Mailgun API is not required

Usage

  1. Load mailgun (this) library
$this->load->library('mailgun');
  1. Initialize library
$this->mailgun->initialize(array(
  'apikey' => 'key-xxxxxxxxxxxxxxxx',                             # API key provided by mailgun
  'domain' => 'example.com'                                       # Domain
));
  1. Set required values
$this->mailgun->from('account@example.com', 'First Last');        # Sender email, and name*
$this->mailgun->to('account@example.com', 'First Last');          # Receiver email, and name*
$this->mailgun->subject('Subject of the email');                  # Subject of the email
$this->mailgun->message('Message body');                          # Message body in HTML

* name is not required

  1. And send, that's all!
$this->mailgun->send();

$this->mailgun->send() will return bool value. If it's TRUE then mail was sent

You can’t perform that action at this time.