
//===================================================== // ScriptMail by Michael Lucas, lucas-photo.com // Copyright 2004, feel free to reuse this // code but please leave copyright info intact. // // Include the following somewhere on your page // (it doesn't matter where, except cannot be nested // in another <form>): // // <form name="mailform" ></form> // // Then call the script like this: // // <a href="javascript:void(0);" onClick="getAction();">send mail</a> // // or // // <a href="javascript:void(0);" onClick="getAction('bob');">send mail</a> // // If the script is called with a user ID parm the // mail will be addressed to that ID at the domain hard- // coded below. Otherwise it defaults to "mainpage". // // Why this works is there is no valid email address // anywhere on the page until the moment the user // clicks the link. //===================================================== function getAction(incoming) { var part4 = "-photo.com"; var part1 = "mailto:"; var part2 = "mainpage"; var part3 = "@lucas"; var part5 = "?subject=From_Main_Page" try { if (incoming.length > 0) { part2 = incoming; } } catch (err) { ; } document.mailform.action = part1 + part2 + part3 + part4 + part5; document.mailform.submit(); }