Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am sending email using MailMessage and setting google font for the email but the email is sent without the assigned font.

Here is my body:

How can i fix this please?

Thanks,
[^]Jassim

What I have tried:

C#
body.AppendLine("<!DOCTYPE html>");
body.AppendLine("<html dir='rtl' lang='ar'>");
body.AppendLine("<head>");
body.AppendLine("<meta charset='UTF-8'>");
body.AppendLine("<meta name='viewport' content='width=device-width, initial-scale=1.0'>");
body.AppendLine("<link href='https://fonts.googleapis.com/css?family=Changa&subset=arabic' rel='stylesheet' />");
body.AppendLine("</head>");
body.AppendLine("<body dir='rtl' lang='ar' style='font-family: Changa'>");
body.AppendLine("<hr /><br />");
body.AppendLine("السلام عليكم " + txtSignupFirstName.Text + "<br /><br />");
body.AppendLine("يرجى استخدام رمز التفعيل الذي تم إرساله على هاتفكم النقال لتفعيل الحساب..<br /><br />");
body.AppendLine("<br /><br />");
body.AppendLine("</body>");
body.AppendLine("</html>");
Posted
Updated 28-Aug-19 3:25am

1 solution

If the "receiver" does not have the font installed on their machine, another font from the same "font family" is substituted by the "system".

Fonts are "files" and do not get downloaded automatically.
 
Share this answer
 
Comments
Jassim Rahma 28-Aug-19 11:36am    
but I am using the http font not a local font and I am sending this email with Google fonts to my Gmail

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900