Search code examples
cssuser-interfacefontsgmailmailer

How to set custom fonts to display text in Mails


There I am editing a Mailer template in core php. However what I am trying to achieve is, I want to set a custom font to the text that is being displayed in the mail template, simply as we set it to any website using CSS and importing fonts.

Following is the code that I am using.

<link href=\"https://fonts.googleapis.com/css?family=Cairo\" rel=\"stylesheet\">
                  <style type=\"text/css\">

body {
       -webkit-font-smoothing: antialiased;
       -webkit-text-size-adjust: none;
       width: 100% !important;
       margin: 0 !important;
       height: 100%;
       color: #676767;
       font-family: 'Cairo', sans-serif !important;
     }

<td class=\"header-lg\" style=\"font-family: 'Cairo', sans-serif !important; font-weight: 500;\">
    Just One More Step To Go...
</td>

But even after applying these things when I send the demo mail to my inbox it still is the default font that is used by Gmail app, browser email and other mail services.

Can anyone suggest how to make it work?


Solution

  • Here are two articles Campaign Monitor - web font support from Campaign Monitor (updated 2015) and Litmus - using web fonts in email Litmus (posted September 2017) that detail web font support in mail apps. Unfortunately, there is no support in GMail web or the apps.