char_rooster has asked for the wisdom of the Perl Monks concerning the following question:

Gracious monks - I am trying to specify a fixed-width font to encode e-mail. I need to display tabular data in the e-mail. HTML encoding is out because the none of the clients has the ability to view it.

I am currently using Mail::Sendmail. Is there a charset specification that will allow me to do this?

Replies are listed 'Best First'.
Re: E-mail font Mail::Sendmail
by flyingmoose (Priest) on Feb 09, 2004 at 18:51 UTC

    It sounds to me like you are saying you need to specify the font (not character set) used to render text-based email.

    I'm fairly sure you can't do that. It is the responsibility of the mail reader to know that text-based emails need to be rendered in fixed-width fonts. My personal mail reader (evolution) does this correctly.

    Maybe it is possible to configure your mail reader to not show text-email in a fixed width font, and maybe some mail readers are broken out-of-the-box ... but still, I don't think this is your problem.

      You have few options, encode the message in a format that allows for describing format (HTML/RTF) or don't expect the format to be similar on all email clients. HTML/RTF is not supported on all clients, so it may be worthwhile to encode a file attachment with the format you want preserved -- ie a pdf with the data formatted as you would like it to be.


      -Waswas
Re: E-mail font Mail::Sendmail
by Anomynous Monk (Scribe) on Feb 09, 2004 at 19:13 UTC
    charset is (mostly) orthogonal to font. Don't think there is a standard way to do this, though the particular mail clients you have to deal with (what are they) just possibly may offer a way.
Re: E-mail font Mail::Sendmail
by fraktalisman (Hermit) on Feb 10, 2004 at 17:31 UTC
    If they don't have HTML in their email client, you could attach a HTML version. But maybe then, the recipients don't want and/or don't need that extra data.
    So rather stay plain text and include a line saying that if the table looks broken, then the human reader should either adjust their e-mail client and change the font, or they could copy or save the mail and display it in another program where they know how to change the font.
    Just interested: what e-mail client do they actually use?
Re: E-mail font Mail::Sendmail
by herveus (Prior) on Feb 19, 2004 at 18:11 UTC
    Howdy!

    E-mail is, fundamentally, a text-only application. Non-plain-text data can be sent via that channel by encoding it into a text representation. Plain text has no concept of "font", "color", or "size".

    I think you are asking the wrong question, or making incorrect associations.

    When I send an e-mail message, I have no control, nor any reasonable expectation of influence over the specific type face, size, or color that the message will apepar in on the recipient's screen. If it is important to specify those parameters as a part of the content you are sending, you have to use a non-plain-text part in a multipart MIME message.

    If you are constructing a text/plain part, you may presume that the recipient will view it in a fixed font. If they choose to use a proportional font, the table will be all messed up, but they should be able to deal with that. If their e-mail program won't let them control the font and inflicts a proportional font on them, they need to get a non-broken reader.

    So, to get to your question: Not that I know of. Just format the text with blanks on the assumption that it will be viewed in a fixed font.

    yours,
    Michael