我使用梨郵件,它的發送好,但我沒有得到所有的$ bodycopy行,即使if語句變量是空的我仍然應該看到頂部和底部破折號,我不是。我的多格式內容的格式/編碼是否已關閉?多個身體線......梨(PHP)郵件
//設置電子郵件
$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 <[email protected]>";
$bcc = "[email protected]";
//$to = "Do Not Reply <[email protected]>";
$subject = "--- Contact : " . $uxGlobalLocation;
$body = $Bodycopy;
$host = "-----";
$port = "25";
$username = "[email protected]";
$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>");
}
如果你不打算解釋發生了什麼問題,那麼反對票的意義何在。它是一個有效的問題,我提供了源代碼... – acctman