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
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.
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:
After updating the user.ini, upload it and PEAR to the document root of your site and Mail.php is ready for use.
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.
$from = "Sender <email@example.com>";
$to = "Recipient <firstname.lastname@example.org>";
$subject = "Mail.php test email";
$body = "Test email sent using Mail.php.";
$host = "sm##.internetmailserver.net";
$username = "email@example.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"
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.