Download the PHP package adrianorsouza/codeigniter-phpmailer without Composer

On this page you can find all versions of the php package adrianorsouza/codeigniter-phpmailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package codeigniter-phpmailer

Codeigniter mail plugin powered by PHPMailer

A simple CodeIgniter mail class to connect your application through the powerful PHPMailer library.

Latest Stable Version Total Downloads Latest Unstable Version License

Tested over CodeIgniter v2.1.4 / v3.0-dev and PHPMailer Version 5.2.7

Install via Composer

To get this plugin via composer is the quick start.

This plugin utilizes Composer for its installation and PHPMailer dependency. If you haven't already, start by installing Composer.

And are available via Composer/Packagist. Once you have Composer configured in your environment run the command line:

This command will write into composer.json beyond download and place this project files and PHPMailer dependencies into your vendor folder.

If you have not included the composer autoload you must do it at the very top of your index.php page or whatever you are running this plugin.

that's all. Your able to send e-mail anywhere inside your CodeIgniter application.

To create an instance of Mail() class:

Alternatively manual installation

If you don't speak Composer, follow this instructions:

place them into your third_party folder or what/you/want as long as you include PHPMailer autoloader where you call the class Mail().

To load class Mail() use the same Codeigniter super-object:

That's all.

Configuration

After get this plugin you have to setup mail_config.php file that contains all mail server configuration that must be placed in your application/config/ folder.

In order to be able to send emails from your local development either production server you must provide a valid SMTP account authentication.

So in this config file, you setup your smtp server and password, login, mail from and etc...

To set up a Gmail smtp account to send your emails, you must set the config mail_smtp_secure to TLS.

To send any message with a HTML template file place it into your views folder. The default folder is views/templates/email if you want to change it, set this in mail_config.php as long as it remains under views folder.

Sample mail_config.php

Usage

Send a basic email message using a string as HTML body.

Send email message as an external HTML template

Send email message as an associative array with external HTML template

Create a HTML template file and name it as sample-2.html.

Then set up a new mail message.

More examples you can find in file Sample_controller.php at application/controllers folder

This class is capable to send email message by passing an array as body content, external template HTML/TEXT file or as string.

If you don't pass an email address as a parameter $to to sendMail($Subject, $to); methods by default $to will be defined with your config mail_replyto_mail value.

You can pass any config from the mail_config.php into class constructor as an array of values:

this will enable BCC e send a copy as BCC to address [email protected]

Notes

  1. If you are not in Composer instead of create new instance class ie: $mail = new Mail(); just load class normally with: $this->load->library('mail'); and use the super object $this->mail->sendMail(); instead.

  2. By default the PHPMailer sends email messages in HTML format and an alternative Plain-Text for those Mail Clients that do not support HTML. But the plain-text content is by default extract from your HTML body and stripped to a text. Sometimes depending on your HTML structure the format of your plain text can be unreadable, So if you want to have a specific template for text-plain format just create a .txt file of your HTML template as the same name ending with .txt extension write it only text with your needs and the Mail plugin will find it and use its contents.

  3. Fell free to custom this plugin with your needs.

Bugs

Have you found a bug? Please open a new issue.

Author

Adriano Rosa

Further reading about PHPMailer

https://github.com/Synchro/PHPMailer

Further reading about CodeIgniter

http://ellislab.com/codeigniter


All versions of codeigniter-phpmailer with dependencies

PHP Build Version
Package Version
Requires phpmailer/phpmailer Version v5.2.7
php Version >=5.2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package adrianorsouza/codeigniter-phpmailer contains the following files

Loading the files please wait ....