Sending HTML email in Java project

Asked

Viewed 62 times

1

I’m having to develop a system that makes a query in a database and the results are sent by email, for formatting we use HTML, the first way I saw was to store the HTML code in a variable, but the organization gets bad and I can’t format the email with CSS for example, know a simpler way to do, isolating in a single document or something like?

String msg =                    
    "<tr>" +
        "<td><strong>" + chamado.get(i).getChamado()  + "</strong></td>" +
        "<td>" + chamado.get(i).getEstado()   + "</td>" +
        "<td>" + chamado.get(i).getAbertoEm() + "</td>" +
        "<td>" + chamado.get(i).getAnalista() + "</td>" +
        "<td>" + chamado.get(i).getAreaUsuario()  + " </td>" +
        "<td>" + chamado.get(i).getSumario()  + "</td>" +
        "<td>" + chamado.get(i).getDataPlanejada()  + "</td>" +
        "<td>" + chamado.get(i).getDetalhamento()+ "</td>" +
    "</tr>";

1 answer

0

I advise you to create the entire html page structure and use the style tag to format via css.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.