Here is the eForm event function that I use to do this:
<?php
function addUserInfo(&$fields){
/* Runs on eFormOnBeforeMailSent event
* Called before the message is sent. This function is called regardless of whether &noemail is set */
if(isset($_SERVER['REMOTE_HOST'])) $fromhost=$_SERVER['REMOTE_HOST'].' ('.$_SERVER['REMOTE_ADDR'].')';
else $fromhost=gethostbyaddr($_SERVER['REMOTE_ADDR']).' ('.$_SERVER['REMOTE_ADDR'].')';
$userInfo='<p>
From: '.$fromhost.'<br />
Using: '.$_SERVER['HTTP_USER_AGENT'].'
</p>';
$fields['userInfo']=$userInfo;
}
return '';
?>
I don’t include a timestamp because the email itself has one, but you could easily do that if you like.
Save this code as a snippet and call it on your form page before the eForm snippet call. In your eForm snippet call add &eFormOnBeforeMailSent=`addUserInfo`. And make sure that you have the [+userInfo+] placeholder at the end of your email template.
eForm event functions are the bomb!