//vrati obsah prumenne s nazvem $name,nebo defoultni nastavi jako $def
function fini($name,$def) {
if(!IsSet($_REQUEST["$name"])):
return $def;
else:
return $_REQUEST["$name"];
endif;
}
?>
$tlacitko=fini("tlacitko",'');
$jmeno=fini("jmeno",'');
$prijmeni=fini("prijmeni",'');
$tel=fini("tel",'');
$email=fini("email",'');
$ulice=fini("ulice",'');
$obec=fini("obec",'');
$psc=fini("psc",'');
$popis=fini("popis",'');
if($tlacitko!="odeslat"): ?>
else:// stisknuto tlacitko odeslat?>
//************ tvorba textu mailu ********************
$Email_Text = "==================== informace o clenstvi =============== \r\n";
$Email_Text .= "\r\n
*Jméno : $jmeno \r\n
*Příjmení : $prijmeni \r\n
telefon : $tel \r\n
e-mail : $email \r\n
---- Adresa ---- \r\n
*Ulice, číslo domu : $ulice \r\n
*Obec : $obec \r\n
*PSČ : $psc \r\n
\r\n
---- Pois zakázky ---- \r\n
*Požadujeme : $typ \r\n
---- Popis ---- \r\n
$popis \r\n
\r\n
";
$recipient = "info@diaspora.cz";
/* subject */
$subject = "informace o clenstvi";
/* message */
$Email_Text;
/* you can add a stock signature */
$message = " "; //Signature delimiter
/* additional header pieces for errors, From cc's, bcc's, etc */
$headers .= "From: Formular
\n";
$headers .= "X-Sender: \n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "X-Priority: 0\n"; // Urgent message! "X-Priority: 1\n";
$headers .= "Return-Path: \n"; // Return path for errors
/* If you want to send html mail, uncomment the following line */
// $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type
//------------- pokus odesilani mailu v kodovani češtiny --------------------
$headers .= "Content-Type: text/plain; charset=windows-1250 \n"; // Mime type
//---------------------------------------------------------------------------
$headers .= "cc:\n"; // CC to
$headers .= "bcc:\n"; // BCCs to
/* and now mail it */
@$OdesOK =mail($recipient, $subject, $Email_Text, $headers);
//-------------------------------------------------------------------
if ($OdesOK):
echo 'Formular byl uspesne odeslan
';
echo '
';
else:
echo "Odesilani selhalo! Pokuste se odeslat formular znovu.
";
endif;
//--------------------------------------------------------------------
?>
endif;?>