A client needed a basic contact form, but the webhost didn’t allow mail() in their scripts. This is what I did:
1. Step
I created a form that sends the required info to this file: createxml.php.
function writeXML($name, $email, $text, $newsletter="true")
{
    if (getenv(HTTP_X_FORWARDED_FOR)) {
 $ip_address = getenv(HTTP_X_FORWARDED_FOR);
    } else {
 $ip_address = getenv(REMOTE_ADDR);
    }

    $myFile = [...]