PHP Classes

File: send_mail

Recommend this page to a friend!
  Classes of Jan Šebestyán   CEmailSender   send_mail   Download  
File: send_mail
Role: Example script
Content type: text/plain
Description: Index of project.
Class: CEmailSender
Compose and send simple text or HTML messages
Author: By
Last change:
Date: 18 years ago
Size: 1,855 bytes
 

Contents

Class file image Download
<?php
 
/***********************************************************************************************/

 
global $telo_emailu;

  require(
"class/email.class.php" );
  require(
"function/presmeruj.fce.php" );
  require(
"function/vystraha.fce.php" );
  require(
"layout/html.layout.php" );

 
/******************************************konfigurace******************************************/
  /**/
$MAIL["prijemce_emailu"] = "tabory@veselaspolecnost.cz"; //adresa prijemce emailu
  /**/
$MAIL["predmet_emailu"] = "Vesela spolecnost ~ Rezervace"; //predmet emailu
  /**/
$MAIL["presmeruj_na"] = "http://www.veselaspolecnost.cz/"; //adresa po odeslani
  /**/
$MAIL["odchozi_adresa"] = "rezervace@veselaspolecnost.cz"; //adresa odesilatele
  /***********************************************************************************************/


 
$email = new Email;
  
//verze MIME
  
$email->Mime( "MIME-Version: 1.0" );

  
//kodovani
  
$email->Kodovani( "Content-type: text/html; charset=UTF-8" );

  
//adresa odesilatele
  
$email->Odesilatel( $MAIL["odchozi_adresa"] );

  
//zpracovani a formatovani dat
  
$email->Formatovani( $MAIL["prijemce_emailu"], $MAIL["predmet_emailu"], $telo_emailu );

   If(
$email->Odeslat( 1 ) ){

   
//potvrzeni odeslani
   
echo Vystraha( "Rezervace akce ".$_POST["nazev"]." byla uspesne odeslana." );

   
//po odeslani presmerovat na stranku
   
echo Presmeruj( $MAIL["presmeruj_na"] );

   } Else {

   
//pokud se email nepodari poslat, napis chybovou hlasku
   
echo Vystraha( "Rezervaci akce se nepodarilo odeslat, zkuste to prosim pozdeji." );

   
//presmeruj zpet
   
echo Presmeruj( $HTTP_REFERER );

   }










 
/**********************************************************************************************/
?>