View Full Version : Bluemail - Multiple to addresses
engineeringguy
05-16-2007, 05:05 PM
Is it possible to have bluemail mail to more than one address?
engineeringguy
05-16-2007, 05:17 PM
I used this as a solution:
if($productsmail){
if($projectsmail){
$mailto = "both@xxxx.com";
}else{
$mailto = "products@xxxx.com";
}
}else{
$mailto = "projects@xxxx.com";
}
I have a form with multiple fields and have an intermediate page to massage the data into a bluemail format. The form has multiple checkboxes and they will go to our products division, projects division or both.
The entire code is:
<body onload="document.MyForm.submit();">
<?
// Change these to change where the email goes
//$mailto = "webrequest@XXXX.com"; //address to where the email goes
$subject = "XXXX.com request for information"; //email subject
////////////////////////////////////////////////
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['mailfrom'];
$orderno = $_POST['Order_Number'];
$location = $_POST['location'];
$quescat = $_POST['category'];
$inquiry = $_POST['inquiry'];
$ip = $_POST['ip'];
$p_actuation = $_POST['Actuation'];
$p_valves = $_POST['Valves'];
$p_meters = $_POST['Metering'];
$p_LACT = $_POST['LACT'];
$p_GLCC = $_POST['GLCC'];
$p_other = $_POST['Other'];
// Looks for what information is requested:
$info= " ";
if($p_actuation){
$info=$info."Actuation, ";
$productsmail="products@XXX.com";
}
if($p_valves){
$info=$info."Valves, ";
$productsmail="products@XXX.com";
}
if($p_meters){
$info=$info."Meters, ";
$productsmail="products@XXX.com";
}
if($p_LACT){
$info=$info."LACT Units, ";
$projectsmail="projects@XXX.com";
}
if($p_GLCC){
$info=$info."GLCC Skids, ";
$projectsmail="projects@XXX.com";
}
if($p_other){
$info=$info."Something else";
$projectsmail="products@XXX.com";
}
if($productsmail){
if($projectsmail){
$mailto = "both@XXX.com";
}else{
$mailto = "products@XXX.com";
}
}else{
$mailto = "projects@XXX.com";
}
// Checks method of preferred Contact
if($_POST['prefer_email']){
$contemail="YES";
}
if($_POST['prefer_call']){
$contphone="YES";
}
/* Changes the location to something readable */
if($location=="Nrockies"){
$location="Northern Rockies";
}elseif($location=="Srockies"){
$location="Southern Rockies";
}
// Composes the email
$body = "Please send me more information. <br>
<br>
<br>
<b>This email has been sent to:</b> $mailto<br>
<br>
My information is:<br>
<b>Name:</b> $name<br>
<b>Phone No:</b> $phone<br>
<b>Email:</b> $email<br>
<b>Order No:</b> $orderno<br>
<b>Contact by email:</b> $contemail<br>
<b>Contact by phone:</b> $contphone<br>
<b>I am located in: $location<br>
<b>My question relates to:</b> $quescat<br>
<b>Send me information regarding:</b> $info<br>
<br>
<b>Inquiry:</b> $inquiry<br>
<br>
Please forward this email to the appropriate parties. Thank you.
<br>
My IP is $ip";
?>
<form action="http://www.bluehost.com/bluemail" name="MyForm" enctype="multipart/form-data" method="POST">
<input type="hidden" name="sendtoemail" value="<? echo $mailto; ?>">
<input type="hidden" name="mailfrom" value="<? echo $email; ?>">
<input type="hidden" name="redirect" value="http://www.XXXX.com">
<input type="hidden" name="subject" value="<? echo $subject; ?>">
<input type="hidden" name="Body" value= "<? echo $body; ?>">
</form>
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.