user17510
user17510

Reputation: 1549

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?

Upvotes: 3

Views: 7920

Answers (5)

garrow
garrow

Reputation: 3489

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

Upvotes: 2

UncleO
UncleO

Reputation: 8449

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.

Upvotes: 1

Sharique
Sharique

Reputation: 4219

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

Upvotes: 1

Fender
Fender

Reputation: 17

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

Upvotes: 2

Chuck Conway
Chuck Conway

Reputation: 16435

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.

Upvotes: 8

Related Questions