To send mail using Mail.php, PEAR will have to be configured and uploaded to the site.  If you would like to manually install PEAR, find the instructions below.  If you require assistance with installing PEAR, please open a ticket with the Support Department.
 
 
Download PEAR.zip
 
 
Inside the .zip is the PEAR directory, an example user.ini and a test script zsend.php.  The PEAR directory contains a web.config to prevent browser access to the subdirectory.  And please note that both the user.ini and the test script have to be configured before use.
 
 
Update and upload user.ini and PEAR directory
 
If the site has an existing user.ini, it will need to be updated with the server path to the PEAR directory.  If the site does not have a user.ini, you can use the example file included in PEAR.zip.
 
The Server Path is found in the Account Info / Edit section of the DiscountASP Control Panel.
 
 
 
If using the example user.ini, only the "username" in the path needs to be updated to match the server path in the Account Info / Edit section:
 
include_path=".;e:\web\username\htdocs\pear\"
 
After updating the user.ini, upload it and PEAR to the document root of your site and Mail.php is ready for use.
 
 
 
Testing Mail.php
 
zsend.php may be used to test whether Mail.php has been properly set up.  Open the file in a text editor and update the settings highlighted in red below.
 
<html>
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once "Mail.php";
$from = "Sender <postmaster@domain.com>";
$to = "Recipient <postmaster@domain.com>";
$subject = "Mail.php test email";
$body = "Test email sent using Mail.php.";
$host = "sm##.internetmailserver.net";
$username = "postmaster@domain.com";
$password = "password";
$headers = array ('From' => $from,
  'To' => $to,
  'Subject' => $subject);
$smtp = Mail::factory('smtp',
  array ('host' => $host,
  'auth' => true,
  'username' => $username,
  'password' => $password));
$mail = $smtp->send($to, $headers, $body);
echo "Mail.php test"
?>
</html>
 
Once updated, save the changes and upload the script to the site.  View the page in a browser and you should see "Mail.php test" returned.  If the email is not received, the path to PEAR in the user.ini and/or the zsend.php settings should be reviewed.
 
To prevent abuse, zsend.php should be deleted from the site after testing.