PHP Classes

File: examples/external-html.php

Recommend this page to a friend!
  Classes of Christian Vigh   PHP Mail Sending   examples/external-html.php   Download  
File: examples/external-html.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Mail Sending
Send HTML email messages with attachments
Author: By
Last change: Update of examples/external-html.php
Date: 1 year ago
Size: 1,127 bytes
 

Contents

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

        The following example sends an email with text and html parts.
       
        The html part contains 2 images, located in the images/ subdirectory (the <img> tags
        explicitly refer to files images/image1.jpg and images/image2.jpg).

        In this example, the html contents are extracted from file "mail.html", which is located
        in the examples/ directory. The LoadHtml() method is called to define the html contents of
        the mail.

        The path used for getting images referenced by the html code will be the directory where
        the "main.html" file is located.

     ****************************************************************************************************/

   
require ( 'examples.inc.php' ) ;

   
$subject = "Example mail : embedded images (html contents loaded from external file)" ;
   
$text = "example text contents" ;

   
$mail = new Mail ( $sender, $recipient, $subject, $text ) ;
   
$mail -> LoadHtml ( dirname ( __FILE__ ) . '/mail.html' ) ;
   
$mail -> Send ( ) ;

    echo (
"Mail sent\n" ) ;