Formatted vs Unformatted Email
Email comes in two main variants, plain text
and formatted html. Formatted html has an undeserved bad reputation. Spammers The
advantages of formatted email are:
The disadvantages of formatted email are:
- You can use font, colour and font size to emphasize the important parts of your
message and deemphasise the unimportant parts, e. g. When elephants fight, it is
the grass that suffers.
- You can embed images, photographs and diagrams.
- Bulleted lists and numbered lists are easy to create. The automatically reflow
to fit the recipient’s screen size.
- You can embed hypertext links rather than including a giant bundle of
information along with the email.
- The reader can decide the size of type. It will reflow automatically. This is
particularly important for the visually impaired.
- In theory, you should be able to use tables to align material in columns.
Unfortunately Eudora does not support tables.
- There is a way to mark parts of your message with <pre> or <code> tags so that
spacing and line ends are precisely preserved. This way code examples don’t
get mangled by newsreaders.
- Your messages have a more personal flavour. They don’t look exactly like
- If you use Unicode, you can use words and phrases from any language you want.
This does not require full HTML (Hypertext Markup Language) formatting.
- If you send them to someone with an old fashioned browser, they will have a
hard time decoding them. Eudora refuses to keep track for you who has a modern and
who has an old fashioned browser. You must keep it in your head.
- There is a temptation to spend too much time on the presentation and not enough
on the content.
- They take longer to transmit because they contain invisible formatting
- They can be easily mistaken for advertising spam.
Security and Privacy
Unfortunately compression, encryption and digital
signing are not yet automatic in email. This means:
- Mail, especially mail with large enclosures, takes five times longer to send
and receive than it should.
- Unpleasant people can snoop on your mail.
- Unpleasant people can send mail that looks as if you sent it
- You are inundated from mail from people you don’t want to hear from.
- Enclosures are send to you even when you don’t want them.
Outlook, Outlook Express and Eudora among others have plug-ins that clumsily
support PGP (Pretty Good Privacy) digital signing and
Outlook, Outlook Express e-mail can do
S/MIME (Secure Multipurpose Internet Mail Exchange) encrypted emails. Unfortunately Eudora still does not
do S/MIME. Perhaps if enough people complain, the Eudora
developers will stop fooling around decorating messages with chili peppers and get on
with the bread and butter issues. software,
Because of the problem of requiring consensus for all sender and receiver email
evolution has been extremely slow.
Email in Java
There are several mail protocols. The most common are SMTP to send mail and POP3 and
to receive it.
To send email from a Java servlet, you
usually would use JavaMail. Simple
applications might use a home brew SMTP or
Applets are problematic. The mail server
must be the one running on the same server as the Applet. You might use JavaMail or a
home brew SMTP (Simple Mail Transfer Protocol) to talk to it. Unsigned
Applets may not talk to any other server than the one it was loaded from.
SMTP is a mess when it comes to
authorisation. Who is allowed to use the server? SMTP
does not have a proper authentication method, just a bunch of ad hoc kludges.
JavaMail does not get you off the hook. It has to use SMTP
To the mail server, send mail requests coming in from your Applet look like
requests from the untamed wild world. It does not know your well behaved Applet is
generating them. They will likely be refused, Further, your Applet could have been
hacked by spammers.
Logically such requests should go to the user’s favourite mail
server, where he will be welcome. However, even if you knew the
URL (Uniform Resource Locator) of his mail server, you could not talk to it without
the hassle of Applet signing.
So what to do?
- Most people handle this by sending the information to a custom servlet and let
the servlet deal with sending the mail. The servlet need not even generate mail. It
can just leave it lying around in a file or database for the recipient to retrieve.
[I hate companies who use this technique with a form demanding more intimate
details than an income tax return, with a one square inch box for your message. It
reminds me of that print legibly joke complaint form of yesteryear.]
- You can send the user to an HTML
page with a mailto: tag in it. If you can persuade the
user to click the mailto: reference. that will wake up
his local mail software which knows his local mail server. Unfortunately, with this
technique your program has no control over the content of the message. Further,
creating such a page on the fly and trying to fool the browser into rendering it
for you is tricky.
There are two different standards for the format of an email
address: Full Name
<email@example.com> and (Full Name)
The official standard RFC 5322 says that
you can create an email address of words (possibly joined together by dots), so long
as you avoid the control characters 0..31, space and
A-Z +-=!#$%^&*~`?|/ are in theory all valid, though I
would avoid all of them but -. Email addresses are
In addition, quoted strings, (possibly joined by dots) are also valid. A
quoted-string is any sequence of characters (0-127) except quote (), backslash (\) and CR (13), surrounded by quotes (). Even the
three excepted characters can appear in a quoted-string if they are individually
escaped with backslash. Anyone using a quotedstring style email address obviously
does not want mail from the general public.
- Eudora: this is the one I use.
It’s main weaknesses: no UTF-8 support. Only
clumsy PGP support. No S/MIME
support. It supports HTML
and plain formats.
- MH, this is the original Unix email program
- MS Outlook and its little brother
Outlook Express. I strongly recommend avoiding these since they are so
susceptible to virus attacks.
- Polarbar: written in Java.
- Thunderbird: Mozilla’s new
email program. It has built-in anti-spam and it keeps track of which of your
respondents like HTML-formatted email and which plain.