Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29745

How to apply styles to a table which is in an email's text body?

$
0
0

I want to send an email by program. In the email's body text I want to include a HTML table. I set the attribute border of the table to be 1 but it is not very good to see : the borders are thick :

var sender = "noreply@mydomain.com";
let transporter = nodemailer.createTransport({
    host: "some_ip_address",
    port: 25,
    secure: false,
    tls: {
        rejectUnauthorized: false
    }
});
transporter.sendMail({
    from: sender,
    to: "some_email@domain.com",
    subject: 'test table html in email',
    html: "Hello,<br/><table border='1'><thead><tr><th>entete 1</th><th>entete 2</th><th>entete 3</th></tr></thead><tbody><tr><td>data 1</td><td>data 2</td><td>data 3</td></tr></tbody></table>"
}, function (error, info) {
    if (error) {
        console.log('============================== Email not sent: ', error);
    } else {
        console.log('============================== Email sent: ', info.response);
    }
});

enter image description here

Is it possible to set a css border to the td elements of the table so that they are like a line of 1 weight ?


Viewing all articles
Browse latest Browse all 29745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>