Skip to content

Instantly share code, notes, and snippets.

@elisei
Forked from tegansnyder/email-test.php
Created January 20, 2017 19:59
Show Gist options
  • Save elisei/20ba95d8a955d2690975d3d79797db56 to your computer and use it in GitHub Desktop.
Save elisei/20ba95d8a955d2690975d3d79797db56 to your computer and use it in GitHub Desktop.
email testing SMTP outbound relay on Magento
<?php
/**
* email-tester.php
* A tool to test if the SMTP relay is working
*
* @category Mmm
* @package EmailTester
* @author Tegan Snyder
*
*/
require_once('app/Mage.php');
umask(0);
Mage::app();
$from_email = Mage::getStoreConfig('trans_email/ident_general/email');
$from_name = Mage::getStoreConfig('trans_email/ident_general/name');
$to_email = 'tsnyder@tegdesign.com';
$to_name = 'Tegan Snyder';
$mail = new Zend_Mail();
$mail->setFrom($from_email, $from_name);
$mail->addTo($to_email, $to_name);
$mail->setSubject('Email test');
$mail->setBodyHtml('Testing the outbound SMTP relay from BEEP');
$mail->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment