I’m using pear mail, its sending okay but I’m not getting all the $bodycopy lines even if the if statement variable are empty I should still see the top and bottom dashes in which I’m not. Is my format/coding for multiple body content off?
// SETUP EMAIL
$Bodycopy = "This information was submitted via the solocup.com website and sent to you because of the location
identified by the user. If this has reached you in error, please forward this email to ----";
$Bodycopy. "<br>----------------------------------------------------------------------------------------------<br><br>";
if ($uxRequestType != "") $Bodycopy. "What kind of information do you need? : " .$uxRequestType. "<br>";
if ($uxConsumerBusiness != "") $Bodycopy. "What type of customer or vendor are you? : " .$uxConsumerBusiness. "<br>";
if ($uxGlobalLocation != "") $Bodycopy. "Global Location : " .$uxGlobalLocation. "<br>";
if ($uxCompany != "") $Bodycopy. "Company : " .$uxCompany. "<br>";
if ($uxFirstName != "") $Bodycopy. "First Name : " .$uxFirstName. "<br>";
if ($uxLastName != "") $Bodycopy. "Last Name : " .$uxLastName. "<br>";
if ($uxTitle != "") $Bodycopy. "Title : " .$uxTitle. "<br>";
if ($uxEmail != "") $Bodycopy. "Email : " .$uxEmail. "<br>";
if ($uxAddress != "") $Bodycopy. "Address : " .$uxAddress. "<br>";
if ($uxCity != "") $Bodycopy. "City : " .$uxCity. "<br>";
if ($uxState != "") $Bodycopy. "State : " .$uxState. "<br>";
if ($uxZip != "") $Bodycopy. "Zip/Postal Code : " .$uxZip. "<br>";
if ($uxPhone != "") $Bodycopy. "Phone : " .$uxPhone. "<br>";
if ($uxFax != "") $Bodycopy. "Fax : " .$uxFax. "<br>";
if ($uxProductDesc != "") $Bodycopy. "UPC or product description : " .$uxProductDesc. "<br>";
$Bodycopy. "<br>----------------------------------------------------------------------------------------------<br><br>";
if ($uxComment != "") $Bodycopy. "Comments : <br>" .$uxComment. "<br>";
$Bodycopy. "<br><br>";
// PROCESS EMAIL
// mail server info…
$from = $SendTo;
$to = "Do Not Reply <----@---->";
$bcc = "--@---";
//$to = "Do Not Reply <---@-->";
$subject = "--- Contact : " . $uxGlobalLocation;
$body = $Bodycopy;
$host = "-----";
$port = "25";
$username = "donotreply@---";
$password = "----";
$headers = array ('From' => $from,
'To' => $to,
'Bcc' => $bcc,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'port' => $port,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
header ('Location: /index.php?option');
exit();
//echo("<p>Message successfully sent!</p>");
}
First step :
Try replacing
by
on all your lines.