In my project, i'm using Servlet/JSP to send an email. I want to add bullets in the body of email when it sent.
Here is my code.
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");
}
How to add bullets ?
Here is the regex to use bullets in java.You can append it wherever you want
[\u2022,\u2023,\u25E6,\u2043,\u2219]\s\d\.\s[A-z]
for ex System.out.println("\u2022");
You can explore other expressions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With