<?php
// ****************************************************************
// Variablen setzen...
$cfg=array();
// sender name...
$cfg['tname'] = 'Hans Wurst';
// sender mail address...
$cfg['tmail'] = 'hwurst@test.de';
// recipient name...
$cfg['fname'] = 'Kloeten Benno';
// recipient mail address...
$cfg['fmail'] = 'kbenno@foo.bar';
// subject...
$cfg['subject'] = 'Testmail...';
// message...
$cfg['message'] = 'Sie haben gewonnen';
// ****************************************************************
// program action...
// Mail senden...
sendmail();
// ****************************************************************
// Email senden...
function sendmail() {
global $cfg;
$mail = popen( "/usr/sbin/sendmail -t ", 'w' );
fputs( $mail, "To: ".$cfg['tname']." <".$cfg['tmail'].">\n" );
fputs( $mail, "From: ".$cfg['fname']." <".$cfg['fmail'].">\n" );
if ( $cfg['ccmail'] ) fputs( $mail, "CC: ".$cfg['ccmail']."\n" );
fputs( $mail, "X-Mailer: PHP-Mailer\n" );
fputs( $mail, "MIME-Version: 1.0\n" );
fputs( $mail, "Content-type: text/plain; charset=utf-8\n" );
fputs( $mail, "Subject: ".$cfg['subject']."\n\n" );
fputs( $mail, $cfg['message']."\n\n" );
// Body der Mail zusammen stellen...
foreach ( $_POST as $name => $value ) {
$message.="$name \t\t\t $value\n"; // Kurzform fuer Verkettung...
// $message=htmlspecialchars($message); // HTML-Sonderzeichen maskieren...
$message=stripslashes( $message ); // Backslashes entfernen...
}
fputs( $mail, $message."\n" );
pclose( $mail );
}
// ****************************************************************
// EOF
?>