Spamgourmet Script

Spamgourmet is a convenient way to create emails, which are only valid once (or more often, if you like). If you don't know about it, I recommend visiting the website at www.spamgourmet.com

I use the following little PHP-Function on my websites to create Spamgourmet-Adresses for use in mailto-Links on the fly.
The Adress contains the IP-Adress of the computer, from where the request for the page containing the adress was made and a Unix-Timestamp. This could help you track down spammers who spider your web for Email Adresses.
You can add an identifier to the adress to help you determin from which page or website the mail was submitted.

Of course it's a little 3-line nobrainer and not pretty sophisticated, but probably it is of use for someone else than me. I use it on http://www.car-vs-car.de/impressum.php for example.

The Function can be called with 3 parameters:

$identifier: Choose a String, that is attached to the IP and timestamp
to identifiy from which website or page the mail was sent from.
$maxMailCount: The maximum number of mails sent to this adress
$accountName: Your Spamgourmet account

The function is called like this...

<a href="mailto:getSpamgourmetEmail("_website",1,"account") ">Email</a>
..which would produce something like this:
192_168_0_25_1094065638_website.1.account@spamgourmet.com
Just copy the following function to your PHP-Page or Library or download the Script here: spamgourmetGenerator.php

<?php
/*
spamgourmet adress-generator Hans Schneider - spamgourmetscript.20.hschnei@spamgourmet.com Just a little nobrainer... Do whatever you want with it. $identifier: Choose a String, that is attached to the IP and timestamp to identifiy from which website or page the mail was sent from. $maxMailCount: The maximum number of mails sent to this adress $accountName: Your Spamgourmet account The function is called like this... <a href="mailto:getSpamgourmetEmail("_website",1,"account") ">Email</a> ..and would produce something like this: 192_168_0_25_1094065638_website.1.account@spamgourmet.com */ function getSpamgourmetEmail($identifier, $maxMailCount, $accountName) { global $REMOTE_ADDR; return str_replace(".","_",$REMOTE_ADDR)."_".time().$identifier.".".$maxMailCount.".".$accountName."@spamgourmet.com"; } ?>