Help - Search - Members - Calendar
Full Version: how to send 1 email with CC instead of 3 separates?
MSFN Forums > Coding, Scripting and Servers > Web Development (HTML, Java, PHP, ASP, XML, etc.)

   


Google Internet Forums Unattended CD/DVD Guide
kabucek
Hi All,

We are using self build online store on CentOS server(php,mysql,https) - CMS.
First Developer created for us field in online store back-end where we can modify emails that are send to customers. As of now, 2 copies are send in separate emails. We want them to be send as one with CC field. How can we modify attached script to do that?

Thanks.

1: [PHP]emailResponseScript:$salesParameters['directoryURL']="https://somedirsomedir/somedir";$salesParameters['submitButtonURL']="https://somedir/somedir/somedir/images/signupnow.gif";
$salesParameters['fieldLabelStyleString']="style=\'font-size:10pt;color:red;padding-right:5pt;\'";$salesParameters['tagFormatString']="<DIV style=\'width:100%;text-align:left;\'><!tag!></DIV>";$salesParameters['anchorStyleString']="style=\'text-decoration:none;color:#4C310D;font-size:12pt;font-weight:bold;\' ";
$emailMessagesArray['1']['templateURL']="https://somedir/somedir/emailTemplates/customerNotification.html";$emailMessagesArray['1']['subjectTemplate']="TEST <!first!> <!last!> <!cartHeader:totalPrice!> <!city!> <!state!> (#<!cartHeader:itemID!>)";
$emailMessagesArray['1']['fromEmailAdr']="registration@something.com";
$emailMessagesArray['1']['fromEmailName']="REGISTRTION DEPARTMENT";
$emailMessagesArray['1']['destEmailAdrTemplate']="<!emailAdr!>";
$emailMessagesArray['1']['destEmailNameTemplate']="<!first!> <!last!>";
$emailMessagesArray['2']['templateURL']=" https://somedir/somedir/emailTemplates/cust...tification.html ";
$emailMessagesArray['2']['subjectTemplate']="Party <!first!> <!last!> <!cartHeader:totalPrice!> <!city!> <!state!> (#<!cartHeader:itemID!>)";
$emailMessagesArray['2']['fromEmailAdr']="registration@something.com";
$emailMessagesArray['2']['fromEmailName']="REGISTRATION DEPARTMENT";
$emailMessagesArray['2']['destEmailAdrTemplate']="registrationdept@something.com";
$emailMessagesArray['2']['destEmailNameTemplate']="Registration"[/PHP]
tain
CODE
[PHP]emailResponseScript:$salesParameters['directoryURL']="https://somedirsomedir/somedir";$salesParameters['submitButtonURL']="https://somedir/somedir/somedir/images/signupnow.gif";
$salesParameters['fieldLabelStyleString']="style=\'font-size:10pt;color:red;padding-right:5pt;\'";$salesParameters['tagFormatString']="<DIV style=\'width:100%;text-align:left;\'><!tag!></DIV>";$salesParameters['anchorStyleString']="style=\'text-decoration:none;color:#4C310D;font-size:12pt;font-weight:bold;\' ";
$emailMessagesArray['1']['templateURL']="https://somedir/somedir/emailTemplates/customerNotification.html";$emailMessagesArray['1']['subjectTemplate']="TEST <!first!> <!last!> <!cartHeader:totalPrice!> <!city!> <!state!>  (#<!cartHeader:itemID!>)";
$emailMessagesArray['1']['fromEmailAdr']="registration@something.com";
$emailMessagesArray['1']['fromEmailName']="REGISTRTION DEPARTMENT";
$emailMessagesArray['1']['destEmailAdrTemplate']="<!emailAdr!>";
$emailMessagesArray['1']['destEmailNameTemplate']="<!first!> <!last!>";
$emailMessagesArray['2']['templateURL']=" [url="https://somedir/somedir/emailTemplates/customerNotification.html"]https://somedir/somedir/emailTemplates/cust...tification.html[/url] ";
$emailMessagesArray['2']['subjectTemplate']="Party <!first!> <!last!> <!cartHeader:totalPrice!> <!city!> <!state!>  (#<!cartHeader:itemID!>)";
$emailMessagesArray['2']['fromEmailAdr']="registration@something.com";
$emailMessagesArray['2']['fromEmailName']="REGISTRATION DEPARTMENT";
$emailMessagesArray['2']['destEmailAdrTemplate']="registrationdept@something.com";
$emailMessagesArray['2']['destEmailNameTemplate']="Registration"[/PHP]


Seems like an overly difficult way of sending mail. But you need to add CC as an extra header. I would use this example:

http://www.php-learn-it.com/php_email.html

CODE
<?php
function send_email($from, $to, $cc, $bcc, $subject, $message){
    $headers = "From: ".$from."\r\n";
    $headers .= "Reply-To: ".$from."\r\n";
    $headers .= "Return-Path: ".$from."\r\n";
    $headers .= "CC: ".$cc."\r\n";
    $headers .= "BCC: ".$to."\r\n";
    
    if (mail($to,$subject,$message,$headers) ) {
       echo "email sent";
    } else {
       echo "email could not be sent";
    }
}

$subject = "Hello!";
$message = "Hello! How are you today?";
send_email("youraddress@domain.com", "recpeient@domain.com",
    "someone@domain.com", "hidden_email@domain.com",
    $subject ,
    $message);
?>






Google Internet Forums Unattended CD/DVD Guide

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.