Location: PHPKode > scripts > WH Board > wh_board/functions/sendmail.php
<?php

	function sendmail() {
    	$goto = $forum;
    	$autoforward = 5;
    	$datenow = date('d.m.Y H:i');
    	$senderip = $_SERVER["REMOTE_ADDR"];

    	$to = htmlentities($_POST["to"]);
    	$name = isset($_POST["name"]) ? htmlentities($_POST["name"]) : "";
    	$from = isset($_POST["from"]) ? htmlentities($_POST["from"]) : "";
    	$homepage = isset($_POST["homepage"]) ? htmlentities($_POST["homepage"]) : "http://";
    	$reason = isset($_POST["reason"]) ? htmlentities($_POST["reason"]) : "";
    	$text = isset($_POST["text"]) ? htmlentities($_POST["text"]) : "";

    	$mailto = $to;
    	$mailfrom = $from;
    	$subject = $reason;
    	$message = '' . $lang['sendet_on'] . ': ' . $datenow . ' | IP: ' . $senderip . '
----------------------------------------------------------------------

' . $lang['blank_name'] . ': ' . $name . '
E-Mail: ' . $mailfrom . '
Homepage: ' . $homepage . '

' . $lang['subject'] . ': ' . $subject . '

' . $lang['message'] . ': ' . $text . '

----------------------------------------------------------------------
' . $lang['sendet_by'] . ': WH Board ' . $lang['contact_form'] . '
';
	
	$headers = 'From:' . $mailfrom . '';
	
	if(mail($mailto, $subject, $message, $headers)) {
    
    echo '<p class="success">' . $lang['pm_sending_success'] . '!</p>
	<meta http-equiv="refresh" content="' . $autoforward . '; URL=' . $goto . '">';

        }else{
        
        echo '<p class="false">' . $lang['pm_sending_failed'] . '</p>';
        }
	}

?>
Return current item: WH Board