Hello
I have been handed this form structure by a client who wants to add a second email address (acct@thesite.com) - The form gets the existing address from a pre-populated field called sEmail -- (admin@thesite.com) -- the contents of the email are in a text style template called _sendOrderToClient.tpl' It captures other field data like this $aCourier, $iOrder $sName $sAmount $sTax.
Can a Bcc be added, or another address --
What they want is a second copy of the form (it's a receipt) to the accounting Dept. Is there a way to do this - I tried to add it via this way
$sTo = $_POST['sEmail,acct@thesite.com'];
$sTo = $_POST['sEmail'],['acct@thesite.com'];
$sTo = $_POST['sEmail','acct@thesite.com'];
Nothing seems to work - I've looked around but I'm lost - can it be done? If so what am I missing.....?
I have been handed this form structure by a client who wants to add a second email address (acct@thesite.com) - The form gets the existing address from a pre-populated field called sEmail -- (admin@thesite.com) -- the contents of the email are in a text style template called _sendOrderToClient.tpl' It captures other field data like this $aCourier, $iOrder $sName $sAmount $sTax.
Can a Bcc be added, or another address --
What they want is a second copy of the form (it's a receipt) to the accounting Dept. Is there a way to do this - I tried to add it via this way
$sTo = $_POST['sEmail,acct@thesite.com'];
$sTo = $_POST['sEmail'],['acct@thesite.com'];
$sTo = $_POST['sEmail','acct@thesite.com'];
Nothing seems to work - I've looked around but I'm lost - can it be done? If so what am I missing.....?
Code:
<?php
if( $p == 'ordersDelivery' && isset( $_SESSION['iOrderSession_'.LANGUAGE] ) && is_numeric( $_SESSION['iOrderSession_'.LANGUAGE] ) ){
if( !function_exists( 'throwOrdersIdTemp' ) ){
require_once DIR_CORE.'orders-'.$config['db_type'].'.php';
require_once DIR_CORE.'orders.php';
require_once DIR_CORE.'couriers-'.$config['db_type'].'.php';
require_once DIR_CORE.'couriers.php';
}
if( isset( $_POST['sOption'] ) && $_POST['sOption'] == 'send' && checkOrderFields( $_POST ) ){
$iOrder = $_SESSION['iOrderSession_'.LANGUAGE];
[COLOR=blue] $sTo = $_POST['sEmail']; [/color]
$sTemplate = $config['language'].'[COLOR=green]_sendOrderToClient.tpl'[/color];
$sTitle = $tpl->tbHtml( $sTemplate, 'EMAIL_TITLE' );
$sEmailContent = listBasket( $iOrder, $sTemplate );
if( !empty( $_POST['iCourier'] ) && !empty( $sEmailContent ) ){
$sEmailContent = $tpl->tbHtml( $sTemplate, 'EMAIL_HEAD' ).$sEmailContent;
$aCourier = explode( '|', $_POST['iCourier'] );
$aCourier = throwCourier( $aCourier[0] );
if( function_exists( 'changeCourierPaymentPrice' ) )
changeCourierPaymentPrice( $aCourier, $iOrder );
$fSummary = tPrice( $aCourier['fPrice'] + $aList['fSummary'] );
$sSummary = changePriceFormat( $fSummary );
$sEmailContent .= $tpl->tbHtml( $sTemplate, 'EMAIL_FOOT' );
}
@mail( $sTo, $sTitle, ereg_replace( '\|n\|', "\n", $sEmailContent ), 'FROM: '.$config['email']."\r\nContent-Type: text/plain; charset=".$config['charset']."\r\n" );
}
}
?>