Company
Date Published
Author
Matt Nikonorov
Word count
1936
Language
English
Hacker News points
None

Summary

To reference CSS stylesheets in HTML-based email through PHP, one can use the `file_get_contents()` function to get the contents of a local or remote stylesheet and store them in a string, which is then used inside the `<style>` tag. This method allows for referencing large stylesheets as well. When referencing external stylesheets from other domains, it's recommended to use HTTPS instead of HTTP to ensure security. Additionally, custom fonts can be referenced using Google Fonts APIs, but with some fallback fonts for email clients that don't support them. Icons and custom fonts are only supported by about 35% of email clients, so this approach may not work in all browsers.