To install PHP Mcrypt simply enter the following terminal command via SSH.
sudo apt-get install php5-mcrypt
You will need the php5-mcrypt extension to be installed in order to run the SMTP WordPress plugin. This is useful for configuring your WordPress mail to run though an external mail server like Gmail, rather than your own server. It can decrease your server load for sending out WordPress notifications and contact form submissions to admins.
For the official PHP installation guide visit… http://php.net/manual/en/mcrypt.setup.php