tags:

views:

155

answers:

5
+2  Q: 

Font in Html mail

Using MailMessage email = new MailMessage();email.IsBodyHtml = true;

Is it possible to set the font for the message?

Also, maybe it's a quirk but p and br tags come out the same for me? Is this normal?

Thanks,

+5  A: 

You can use CSS:

<style>
   p {color:#999; font-family:arial;} /*grey*/
</style>

You are limited to what fonts are install on the receivers machine.

Chuck Conway
+2  A: 

I would suggest researching using a style sheet attribute to change the font size.

Not sure what you mean by the 'and tags come out the same for me' part... come out the same as what?

...charles beat me to it

Fender
+1  A: 

You can include css in body of mail. Since mail body is in html format, all html features can be used here.

Sharique
+1  A: 

No, break and paragraph tags are not the same.

Break just starts on a new line, paragraph adds some space around it. They also cause floating objects to behave differently around them.

They can also be styled independently using css.

UncleO
+2  A: 

When dealing with HTML email's you will find a multitude of frustrations.
Some issues I can remember

  • Some mail clients won't render CSS when it is placed outside the <body> element.
  • Some mail clients won't render CSS at all.

A great resource for HTML email is email-standards.org

garrow