我有一個聯繫表單,它在提交時將所有表單的數據發佈到電子郵件操作中,然後以純文本形式呈現確認電子郵件。數據即將通過,但一些行忽略了它們各自的換行符。JSP純文本電子郵件不呈現換行符
JSP:
<%@ page language="java" contentType="text/plain;" %><%@ page import="com.shared.Configuration" %><%@ taglib uri="/WEB-INF/jstl-core.tld" prefix="c" %>Contact Us Form: ${issue}
Name: ${name}
Email Address: ${emailAddress}
<c:if test="${not empty accessCode}">Access Code: ${accessCode}</c:if>
<c:if test="${not empty itemId}">Inventory Number: ${itemId}</c:if>
<c:if test="${not empty title}">Title: ${title}</c:if>
<c:if test="${not empty device_active}">User Device: ${device}</c:if>
<c:if test="${not empty os_active}">User Operating System/Version: ${operatingSystem}</c:if>
<c:if test="${not empty browser_active}">User Web Browser/Version: ${webBrowser}</c:if>
<c:if test="${hasError eq 'Y' or hasError eq 'N'}"><c:choose><c:when test="${hasError eq 'Y'}">Error Message: ${errorMessage}</c:when><c:otherwise>No Error message was present</c:otherwise></c:choose></c:if>
<c:if test="${not empty otherDetails}">Other Details: ${otherDetails}</c:if>
<c:if test="${not empty problemDetails}">Problem Details: ${problemDetails}</c:if>**
正如你所看到的,有很多IF條件句,基本上,這些都是在地方作爲節省空間,如果用戶沒有在任何這些信息輸入字段,那麼不要把它們放在電子郵件中。
由於它位於Mac OS X Mail客戶端,因此所有基於Web的客戶端都可以呈現電子郵件。展望是不是在玩好的唯一的一個,並呈現出它的電子郵件這樣:
Outlook電子郵件結果:
Contact Us Form: Can't access the extra PlayBack+ features
Name: me
Email Address: [email protected]
Access Code: aqwsedrftgyhuj87
Inventory Number: 12345678
Title:Title: this track
User Device: Desktop
User Operating System/Version: Mac OS 10.9.5 User Web Browser/Version: Chrome 55 Error Message:
Other Details:no other details Problem Details:
線從用戶OS,用戶瀏覽器,錯誤信息和問題爆發細節不到位。辦公室裏沒人有解決辦法。那裏的人都知道發生了什麼事?