MSFN Forum: how to send 1 email with CC instead of 3 separates? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

how to send 1 email with CC instead of 3 separates? web development Rate Topic: -----

#1 User is offline   kabucek 

  • Member
  • PipPip
  • Group: Members
  • Posts: 102
  • Joined: 07-August 06

Posted 11 May 2009 - 09:12 AM

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:
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"



#2 User is offline   tain 

  • Cyber Ops
  • Group: Super Moderator
  • Posts: 3,443
  • Joined: 24-September 05
  • OS:none specified
  • Country: Country Flag

Posted 11 May 2009 - 09:27 AM

[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.../php_email.html

<?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);
?>


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy