Send order email by ID
<?php
/** Order email Send
* @link https://www.steve-berrill.com/
* @author Steve Berrill, http://www.steve-berrill.com/
* @copyright 2017 Steve Berrill
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @version 1.0.0
*/
// gain access to magento
error_reporting( E_ALL );
require_once "app/Mage.php";
Mage::app('admin');
// set order id
$orderId = '10000000';
$customEmail = 'your-email';
try {
// send order email
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
// check if oirder id exists
if ($order->getId()) {
$order->setCustomerEmail($customEmail);
$order->sendNewOrderEmail();
echo "Order #$orderId successfully sent to $customEmail";
//print_r($order->debug());
} else {
// if no order id was found
echo "Order #$orderId not found\n";
}
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}