Setting up SMTP mail server for locally hosted Mediawiki

Email service is a MediaWiki Component, which do not come pre-configured and requires some edits to the LocalSettings.php to set up. Basically, you are sending mails from your mediawiki running on your localhost/ or vagrant using the gmail smtp server.

  1. You need to install the following packages :
  2. sudo apt-get install php-pear
    sudo pear install mail
    sudo pear upgrade MAIL Net_SMTP

  3. Now edit your LocalSettings.php to include :

    $wgEmergencyContact = “apache@localhost”;
    $wgPasswordSender = “apache@localhost”;
    $wgNoReplyAddress = “”;

    $wgSMTP = array(
    ‘host’ => “ssl://”,
    ‘IDhost’ => “”,
    ‘port’ => 465,
    ‘auth’ => true,
    ‘username’ => “”,
    ‘password’ => “yourPassword”

If your firewall doesn’t check port 465 && smtp service is unblocked, you are ready to send your mail.  In order to test, go to
and click on send Confirmation Code. Check your inbox ! 🙂
Instructions to check whether your port is open will be included in the next post.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s