PEAR::Mail on XAMPP for Windows

How to install the PEAR::Mail package (class) on XAMPP for Windows

What is PEAR::Mail?

"Mail" is a class that provides multiple interfaces for sending emails.
Source: https://pear.php.net/package/Mail

 

PEAR::Mail Installation on XAMPP for Windows

First run the XAMPP Control Panel and click on "Shell":

 

XAMPP for Windows Control Panel - run Shell

 

Type in the following code in the XAMPP Shell window:

pear install -a Mail

 

Install PEAR::Mail on XAMPP for Windows

 

Hit Enter to start the installation:

 

PEAR::Mail Installation

 

The option -a has automatically installed all other required packages.
The installation is done ... you can close the XAMPP for Windows shell.

 

 

Test if PEAR::Mail is installed

You can test if PEAR and PEAR::Mail is installed using a simple php test file.
(Requires php 5.3.2 or php 7++)

 

File: test-pear-mail.php

<?php

if (!stream_resolve_include_path('System.php'))
{
    echo"PEAR not installed :(";
}
else
{
    echo"PEAR installed: ";
    echo stream_resolve_include_path('System.php');
}

if (!stream_resolve_include_path('Mail.php'))
{
    echo"\nPEAR::Mail not installed :(";
}
else
{
    echo"\nPEAR::Mail installed!: ";
    echo stream_resolve_include_path('Mail.php');
}

?>

 

How it works:

The function "stream_resolve_include_path" resolves a filename against the include path.
It returns the path or false if the file was not found.
The file "System.php" contains the PEAR class and "Mail.php" the PEAR::Mail class.

Disclaimer: The information on this page is provided "as is" without warranty of any kind. Further, Arclab Software does not warrant, guarantee, or make any representations regarding the use, or the results of use, in terms of correctness, accuracy, reliability, currentness, or otherwise. See: License Agreement