我正在使用梨邮件,它可以发送,但即使 if 语句变量为空,我也没有收到所有 $bodycopy 行,我仍然应该看到我不是的顶部和底部破折号。我的多个正文内容的格式/编码是否关闭?
// 设置电子邮件
$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>";
// 处理电子邮件
// 邮件服务器信息...
$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>");
}