function mailform($input = [])
{
$source = empty($input['subject']) ? 'reactie' : $input['subject'];
- $rcpt = 'info@'.$_SERVER['HTTP_HOST'];
+ $domain = preg_replace('/^www\./', '', $_SERVER['HTTP_HOST']);
+ $rcpt = "info@$domain";
$subject = "Formulier {$_SERVER['HTTP_HOST']}: $source";
if (!$input) {
}
$reply = preg_match('/\A\w+@\w+\.[a-z]+\z/', @$input['email'])
- ? $input['email'] : 'noreply@'.$_SERVER['HTTP_HOST'];
+ ? $input['email'] : "noreply@$domain";
$header = "From: $reply";
foreach (array(