I have a powershell script that sends out an HTML formatted email, the formatting looks perfect in Outlook but does not work in GMAIL, any suggestions? The HTML used is:
#HTML
$a = "<style>"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 10px;border-style: solid;border-color: black;}"
$a = $a + "TD{border-width: 1px;padding: 10px;border-style: solid;border-color: black;}"
$a = $a + "</style>"
Thanks.
Gmail removes your entire <style> block if it encounters an error. Gmail strips HTML formatting entirely if it encounters even one error.
Gmail only supports <style> in the <head> . Gmail does support embedded styles ( <style> ). However, embedded styles are only supported in the head of your HTML document. The Gmail Android and iOS apps does not support <style> at all when rendering emails retrieved through non-Google accounts (GANGA).
GMail tends to prefer inline styles. As such:
<table style="border: 1px solid black; border-style: collapse;">
<tr style="border: 1px solid black; padding: 10px;">
<td style="border: 1px solid black; padding: 10px;">
</td>
</tr>
</table>
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