PHP Classes

File: sample3.php

Recommend this page to a friend!
  Classes of Grigori Kochanov  >  Smarty and MIME message integration  >  sample3.php  >  Download  
File: sample3.php
Role: Example script
Content type: text/plain
Description: sample 3 - send multipart email
Class: Smarty and MIME message integration
Send e-mail messages using Smarty templates
Author: By
Last change:
Date: 9 years ago
Size: 1,037 bytes


Class file image Download
require_once "my_smarty.class.php";

 * To send a multipart (HTML + plain text) letter you should create two templates -
 * one with the ".html.tpl", another - with ".txt.tpl" extension
 * in the Smarty template folder
 * If I define the 'x_from_address' (and 'x_from_name') parameter - the script will send the letter
 * "on somene's behalf". This may help sending the letter from other people address
 * and not have the it misrecognized as spam by filters.

$options = array(
'template'=>'sample3', //no extension here - the type of the letter is determined by file extension
'to_name'=>'Grigori Kochanov',
'from_name'=> 'Joe Black',
'from_address'=> '',
'x_from_name'=> 'Grigori Kochanov',
'x_from_address'=> '',

$EML = new myMail();
$EML->assign('var','World'); // generic Smarty assign