PHP Classes

File: example3.php

Recommend this page to a friend!
  Classes of Valentin   IDtpl   example3.php   Download  
File: example3.php
Role: Example script
Content type: text/plain
Description: example script (3) shows how you can send e-mail with templates
Class: IDtpl
Template engine based on PHP template scripts
Author: By
Last change: fix
Date: 16 years ago
Size: 610 bytes
 

Contents

Class file image Download
<?php
//mail sending example
require_once('idtpl.class.php');
$template = new IDtpl('templates/');

$to= '[email protected]';
$subj= 'Qwe Zxc !!!';

//make headers
$template->define('priority', 3);
$template->define('from', 'ZXC');
$template->define('fmail', '[email protected]');
$template->template('mail_headers.tpl');
$headers= $template->gethtml();

//make message
$template->define('mailtext', 'many many many text!!!');
$template->template('mail_template.tpl');
$message= $template->gethtml();

//and so, as we prepared all we need we can now send message
mail($to,$subj,$message,$headers);
?>