在我的項目中,我使用Servlet/JSP發送電子郵件。我想在發送郵件時在郵件正文中添加項目符號。如何在Java郵件正文中添加項目符號
這是我的代碼。
Servlet.java:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String subject= "[ MARMOTTE ][ "+env+" ] Demande d’habilitation";
String body = "Demande d’habilitation du "+ chaineDate +" pour :\n";
body += "identifiant : "+identifiant+" ;\n";
body += "Nom : "+nom+" ;\n";
body += "Prénom : "+prenom+" ;\n";
body += "Téléphone : "+telephone+" ;\n";
body += "Email : "+email+" ;\n";
body += "UO : "+uo+" ;\n";
body += "Etablissement : "+etablissement+" ;\n";
body += "Motif de la demande : "+motif+".\n";
String to = System.getProperty("mail.destinataire.moa");
String from=email;
EMail.send(subject, body, to, from);
response.sendRedirect("demanderHabilitationFait.jsp");
}
如何添加項目符號?
子彈?你能更具體嗎? –
將它作爲html電子郵件,然後使用html標記作爲項目符號。另外,只需使用ascii字符(例如'-'或'*')和換行符。只有提供更多信息,才能提供更多詳情。你試過什麼,EMail.send(...)'在做什麼等等。 – Thomas
是否在字符串'body'中增加了'\ u2022' unicode help? – nullpointer