$WikiTitle. De beheerder van de site heeft geen invloed op het gebruik van het formulier."; SDV($MailFormTitle,"Mail a Friend"); SDV($MailFormThankYou,"Thanks ! The page has been send"); SDV($MailFormSendTo,"Send this page by email to"); SDV($MailFormSendFrom,"Your email"); SDV($MailFormText,"Enter a message"); SDV($MailFormSubject,"Cool page"); SDV($MailFormNoHTML,"No HTML? Visit the page"); SDV($MailFormDefaultText,"Hi, I found this cool page! Maybe worth to look at"); SDV($MailFromErrorEmail,"This email doesn't look right:"); SDV($MailFromDisclaimer,"This email has been send from an mailform on $WikiTitle. We appolegize if this mail bla bla"); SDV($HandleActions['mailform'],'HandleMailForm'); SDV($HandleMailFmt,array(&$PageStartFmt, &$PageMailFormFmt,'function:PrintText', &$PageEndFmt)); SDV($PageMailFormFmt,"

$MailFormTitle

$MailFormSendTo

$MailFormSendFrom

$MailFormText

"); function HandleMailForm($pagename) { global $HandleMailFmt,$HandleActions,$Text,$MailFormTitle; $page = RetrieveAuthPage($pagename,"read"); if (!$page) { Abort("?cannot read $pagename"); } $Text=$page['text']; SetPageVars($pagename,$page,$MailFormTitle); ProcessTextDirectives($pagename); if (@$_POST['post']) { HandlePostMailForm($pagename); } PrintFmt($pagename,$HandleMailFmt); } function HandlePostMailForm($pagename) { global $PageMailFormFmt; global $MailFormDefaultText; global $MailFromErrorEmail; global $WikiTitle; global $MailPostsFrom; global $MailPostsTo; global $MailFormNoHTML; global $MailFormThankYou; $sendto=@$_POST['sendto']; $sendfrom=@$_POST['sendfrom']; $mailtext=@$_POST['mailtext']; // Validate the Email Address $pagelink=FmtPageName('$PageUrl',$pagename); if(!ereg("^([a-z0-9]|\\-|\\.)+@(([a-z0-9]|\\-)+\\.)+[a-z]{2,4}\$",$sendto)){ $error = 1; $error_html .= "$MailFromErrorEmail: $sendto

\n"; } if(!ereg("^([a-z0-9]|\\-|\\.)+@(([a-z0-9]|\\-)+\\.)+[a-z]{2,4}\$",$sendfrom)){ $error = 1; $error_html .= "$MailFromErrorEmail: $sendfrom

\n"; } if ( $error ) { $PageMailFormFmt=$error_html; return; } $PageMailFormFmt="$MailFormThankYou
"; $mailtext= htmlspecialchars($mailtext,ENT_NOQUOTES); $message ="$MailFormNoHTML : $pagelink\n\n"; $message .="
$mailtext
" ; $message .="$pagelink
"; ob_start(); PrintText($pagename); $message .=ob_get_clean(); $message .="
$MailFromDisclaimer"; /* recipients */ $to = $sendto ; /* subject */ $subject = "$MailFormDefaultText $pagename"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; /* additional headers */ $headers .= "From: $WikiTitle <$MailPostsFrom>\r\n"; $headers .= "Cc: $sendfrom\r\n"; $headers .= "Bcc: $MailPostsTo\r\n"; /* and now mail it */ mail($to, $subject, $message, $headers); #print "
$message
"; } ?>