Download the PHP package ivantcholakov/codeigniter-phpmailer without Composer
On this page you can find all versions of the php package ivantcholakov/codeigniter-phpmailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ivantcholakov/codeigniter-phpmailer
More information about ivantcholakov/codeigniter-phpmailer
Files in ivantcholakov/codeigniter-phpmailer
Package codeigniter-phpmailer
Short Description A CodeIgniter 3 compatible email-library powered by PHPMailer.
License MIT
Homepage https://github.com/ivantcholakov/codeigniter-phpmailer
Informations about the package codeigniter-phpmailer
A CodeIgniter compatible email-library powered by PHPMailer
Version: 1.5.0
Author: Ivan Tcholakov [email protected], 2012-2022.
License: The MIT License (MIT), http://opensource.org/licenses/MIT
This library is compatible with CodeIgniter 3.1.x and PHP >= 7.3.0.
Tested on CodeIgniter 3.1.13 (March 3rd, 2022) and PHPMailer Version 6.6.4 (August 22nd, 2022).
Links
Package: https://packagist.org/packages/ivantcholakov/codeigniter-phpmailer
PHPMailer: https://github.com/PHPMailer/PHPMailer
Installation
Enable Composer to be used by CodeIgniter. Check this page from its documentation: https://www.codeigniter.com/userguide3/general/autoloader.html . You need to see or decide when your vendor/ directory is (to be) and within the CodeIgniter's configuration file application/config/config.php you need to set the configuration option $config['composer_autoload'] accordingly. For the typical location application/vendor/ the configuration setting would look like this:
Within application/config/constants.php add the following lines:
It is assumed that Composer's vendor/ directory is placed under CodeIgniter's application/ directory. Otherwise correct the setting so VENDORPATH to point correctly.
If PHPMailer was previously installed through Composer, uninstall it temporarily:
Now install this library's package, it will install a correct version of PHPMailer too:
Create a file application/helpers/MY_email_helper.php with the following content:
Create a file application/libraries/MY_Email.php with the following content:
This is an installation that is to be done once. Updating to next versions of this package and PHPMailer would be done later easily:
Configuration and Sending an E-mail (An Example)
Create if necessary or edit the file application/config/email.php
which contains
the default settings for the email engine. For a Gmail account, the setting might be something like this:
Notes: Set $config['useragent'] as 'PHPMailer' in order PHPMailer engine to be used. PHP openssl module should be enabled if encrypted SMTP access is required.
Within a controller paste the following code for testing purposes:
Load the corresponding page, executte this code. Check whether an email has been sent. Read the error message, if any, and make corrections in your settings.
Note, that most of the SMTP servers require "from" address of the message to be the same as the address within $config['smtp_user'] setting.
At the end remove this test.
The API of this library is the same as the original Email API. Read the CodeIgniter's manual about Email Class.
For supporting CodeIgniter 2.x and CodeIgniter 3.0.x a manual installation of an older version of this library is needed, see https://github.com/ivantcholakov/codeigniter-phpmailer/tree/1.3-stable
All versions of codeigniter-phpmailer with dependencies
phpmailer/phpmailer Version ^6.6.4
league/oauth2-google Version ^4.0.0
hayageek/oauth2-yahoo Version ^2.0.5
stevenmaguire/oauth2-microsoft Version ^2.2.0