PEAR is a PHP framework from The PHP Group
that provides reusable PHP components or classes. PEAR::Mail
is one of these classes and it provides advanced interfaces to PHP
applications and programs for sending emails. The SMTP interface allows a
PHP application to access an external SMTP server with control over various
options such SMTP ports and authentication.
IMPORTANT: These instructions are a basic guide demonstrating the
minimum code required to send a message using PEAR::Mail through AuthSMTP. They are not a guide to a complete or secure setup
of an email application, for
further instructions on using and securing PHP and PEAR::Mail please see their
website's:- PEAR::Mail - PHP.net
Requirements: PEAR::Mail is NOT part of a base PHP
installation, it is an advanced framework that needs to be
installed separately on the web server that is running your
website, if you are unsure if you have access to it you will
need to contact your web hosting company or network
First you need to make sure the email address(es) you will be sending from have been authorised for your account in our Control Panel.
Create a file called authsmtp-test.php on your web server containing the only the following code:
Change the following lines:
- $recipients to your email address
- $headers['From'] to your email address
- $headers['To'] to your email address
- 'USERNAME' to your AuthSMTP username
- 'PASSWORD' to your AuthSMTP password
Save the file to your web server.
Open a web browser and view the uploaded authsmtp-test.php file
on the Internet.
You should see a list of the parameters you have entered and the
SMTP conversation, if it was successful you will see at the end of
the conversation a section that reads 'Message accepted for
This means that AuthSMTP can be used from your web server and you can continue to
integrate this into your form / application.
We recommend that when you do, you store the username and
password variable definitions in a separate PHP file outside your
public web directory and reference back to it. Storing them in a
public PHP file is a potential security risk.
IMPORTANT: Enabling or disabling SSL
Currently PEAR::Mail has SSL/TLS enabled for SMTP and it will always try
to negotiate a secure connection, there is no configuration parameter to
change this setting.
By default we do not enable SSL on your account
so you have two options: