EmailAddrApplet

A simple applet which formats and displays an email address in a clickable button.
or, How to put an email address on a web page without getting tons of spam / junk mail
Page index Sample code Parameters Fonts
Colours   Download


Odds and Ends
Index
EBCDIC tables
EmailAddrApplet
IDD phone codes
Riding a Bike
Vitamins



 

This page documents a simple Java applet I wrote to allow me to put my email address on various web pages and not get inundated with junk / spam mail.

EmailAddrApplet displays an address in a clickable button. If visitor clicks on the button he sees new mail window with the address filled in - think of it as a substitute for the mailto: tag, where in order to get a clickable link you include html such as;
     <a href="mailto: me@somedomain.com">My Name</a>
An extreme example of what the applet looks like with all the labels defined is shown below;

This applet requires Java, please either enable Java or complete the form below.

The key to avoiding putting yourself on tons of totally worthless spam lists seems to be to not put an easily recognised email address within any sort of html. Thus, the Email address is formatted from two parameters - NAME and DOMAIN. These simply correspond to the portion of email address either side of the '@' sign. This should be sufficient to avoid being picked up by spam trawlers. At some point I'll likely add some sort of encryption code.

In order to improve the way the applet appears within a web page one or more labels can be specified above, below, left, & right. Font, colours etc are fully customisable.

The applet works this works in the same way as the HTML MAILTO tag in an href. The fundamental difference being that no email address appears in html.

The applet's JAR file is completely free. You can download copy it, distribute anything you like provided you give me credit by including my name and website URL on any reference to it.

Sample code

Here is the html used to create the applet shown above.

<applet archive="EmailAddr.jar" code="EmailAddrApplet.class"          
  width="400" height="100">
<param name="BGCOLOUR" value="#ffffdd">
<param name="BUTTONBGCOLOUR" value="#ff0000">
<param name="BUTTONFGCOLOUR" value="#00ff00">
<param name="BUTTONFONT" value="serif,20,ITALIC">
<param name="LABELFONT" value="serif,14,PLAIN">
<param name="LEFTLABEL" value="Left Label">
<param name="RIGHTLABEL" value="Right Label">
<param name="TOPLABEL" value="Top Label">
<param name="BOTTOMLABEL" value="Bottom Label">
<param name="NAME" value="sinto">
<param name="DOMAIN" value="doggyworld.com">
</applet>

Parameters

The applet supports the following parameters via PARAM / VALUE pairs.

BGCOLOUR
The overall background colour to use for the applet. You probably want to the match the page background colour.
BOTTOMLABEL
Text string to place below the button
BUTTONBGCOLOUR
Background colour of the button
BUTTONFGCOLOUR
Foreground (text) colour of the button / email address
BUTTONFONT
The font to use for the button / email address
DOMAIN
The domain portion of the email address - after the '@' sign
LABELCOLOUR
Foreground (text) colour of the labels
LABELFONT
The font to use for the labels
LEFTLABEL
Text string to place to the left of the button
NAME
The name portion of the email address - before the '@' sign
RIGHTLABEL
Text string to place to the right of the button
TOPLABEL
Text string to place above the button

Font specification

Font are specified with a comma separated string in the following format;
      fontname,size,style [,style ]

fontname
A font name acceptable to the java.awt.Font() creation method - either a logical font name or a font face family. A few logical names are Dialog, DialogueInput, Monospaced, Serif, SansSerif
size
The point size of the font to use
style
One of more of the keywords PLAIN, BOLD, ITALIC. These must appear in uppercase.

Colours

All colour parameters take either the standard HTML hexadecimal representation of a colour, or one of the (few) Java built-ins. These are:
BLACK, BLUE, CYAN, DARKGREY, GREY, GREEN, LIGHTGREY, MAGENTA, ORANGE, PINK, RED,WHITE, YELLOW.

Finally if you're an American and believe Colour should be mis-spelt "C-O-L-O-R", well you've been wrong all these years, and I suggest you educate yourself by obtaining a copy of the Concise Oxford English dictionary.

Download

Download the the applet's jar file here

 

 



Home Thai Guide   Great Circle Calculator WorldClock AMS Services Contact us