Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add bullets in the body of email in Java

Tags:

java

email

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 ?

like image 563
youssef Avatar asked Dec 09 '25 03:12

youssef


1 Answers

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");
  • will print normal bullet.

You can explore other expressions

like image 112
Vikram Saini Avatar answered Dec 11 '25 16:12

Vikram Saini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!