Skip to Main Content
Software Help

Creating Secure Mail Links

Creating secure mailto links on a web page outside of the COCC Community.

NOTE: Community users should follow the instructions included here.

1) In your editor of choise change to HTML edit mode so you can see the HTML code.

2) Wherever you have existing mailto links

    probably something like the following…
        <a href="mailto:someone@cocc.edu">click here</a>
       OR
        <a href="mailto:someone@cocc.edu">someone@cocc.edu</a>
    …something like one of those.

You want to replace each with the below code (correctly edited for the email address and/or message that you want to display). What you would need to change is highlighted in Red... The rest should stay exactly as is.

To display a mail to link that has message text like the first example above, do this:

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    user = "someone";
    site = "cocc.edu";
    document.write('<a href=\"mailto:' + user + '@' + site + '\">');
    document.write('click here' + '</a>');
    // End -->
    </SCRIPT>

To display the email address as with the 2nd example above do this:

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    user = "someone";
    site = "cocc.edu";
    document.write('<a href=\"mailto:' + user + '@' + site + '\">');
    document.write('<IMG align=absmiddle border=0 src="http://www.cocc.edu/spamage.aspx?u=' + user + '&s=' + site + '">' + '</a>');
    // End -->
    </SCRIPT>

Please send questions to .