PHPMailer permet d’envoyer des Emails depuis une application écrite en langage PHP. Voici comment l’installer sous Linux Debian 9:

Il faut d’abord avoir installé « curl », si ce n’est pas déjà fait:

$ sudo apt update

$ sudo apt install curl

Puis installez composer :

$ sudo curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...
Composer (version 1.10.6) successfully installed to: /var/www/activgest/programs/composer.phar
Use it: php composer.phar
$

Déplacez le programme composer.phar dans le dossier des applications:

$ sudo mv composer.phar /usr/local/bin/composer

$

Rendre le programme composer exécutable:

$ sudo chmod +x /usr/local/bin/composer 

$

Vérifiez que composer fonctionne:

$ composer -V Composer version 1.10.6 2020-05-06 10:28:10 

$

Par la suite, vous pourrez mettre à jour composer par cette commande:

$ sudo composer self-update 
You are already using composer version 1.10.6 (stable channel). 

$

Puis installez PHPMailer à l’aide de composer:

$ composer require phpmailer/phpmailer
Using version ^6.1 for phpmailer/phpmailer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing phpmailer/phpmailer (v6.1.6): Downloading (100%)
phpmailer/phpmailer suggests installing psr/log (For optional PSR-3 debug logging)
phpmailer/phpmailer suggests installing league/oauth2-google (Needed for Google XOAUTH2 authentication)
phpmailer/phpmailer suggests installing hayageek/oauth2-yahoo (Needed for Yahoo XOAUTH2 authentication)
phpmailer/phpmailer suggests installing stevenmaguire/oauth2-microsoft (Needed for Microsoft XOAUTH2 authentication)
phpmailer/phpmailer suggests installing symfony/polyfill-mbstring (To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2))
Writing lock file
Generating autoload files
1 package you are using is looking for funding.
Use the `composer fund` command to find out more!
$

 

 

Print Friendly, PDF & Email

Leave a Reply

You have to agree to the comment policy.

Blue Captcha Image
Refresh

*

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.