Setting up PEAR mail on Scotch Box

You have Vagrant and Scotch Box installed. You still need to install Pear.

$ vagrant ssh
$ sudo apt-get -y install php-pear
$ sudo pear install mail_mime

In your PHP script

include_once('Mail.php');
include_once('Mail/mime.php');

Parameters to define SMTP Scotch Box

$params["host"] = "127.0.0.1";
$params["port"] = 1025;
$params["Date"] = date('r',time());
$mail = Mail::factory("smtp",$params);
...

Catch mails in Mailhog at http://192.168.33.10:8025

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.