Skip to content

Instantly share code, notes, and snippets.

@pstuifzand
Created March 8, 2015 13:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pstuifzand/6ff46ced1b09cea8e2f2 to your computer and use it in GitHub Desktop.
Save pstuifzand/6ff46ced1b09cea8e2f2 to your computer and use it in GitHub Desktop.
Use Magento (Zend_Mail) with Mailcatcher
<?php
class Test_Test_Model_Observer {
public function _construct() {}
public function fixEmailConfig($observer) {
if (Mage::getStoreConfigFlag('dev/email/enabled')) {
$ip = $_SERVER["REMOTE_ADDR"];
$config = array('port' => '1025');
$tr = new Zend_Mail_Transport_Smtp($ip, $config);
Zend_Mail::setDefaultTransport($tr);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment