예제 #1
0
 ** html versions of the mail. Don't
 ** have to be named as these are. Just
 ** make sure the names tie in to the
 ** $mail->add_html() call further down.
 ***************************************/
$text = $mail->get_file('example.txt');
$html = $mail->get_file('example.html');
/***************************************
 ** Add the text, html and embedded images.
 ** Each embedded image has to be added
 ** using $mail->add_html_image() BEFORE
 ** calling $mail->add_html(). The name
 ** of the image should match exactly
 ** (case-sensitive) to the name in the html.
 ***************************************/
$mail->add_html_image($background, 'background.gif', 'image/gif');
$mail->add_html($html, $text);
/***************************************
 ** This is used to add an attachment to
 ** the email.
 ***************************************/
$mail->add_attachment($attachment, 'example.zip', 'application/zip');
/***************************************
 ** Builds the message.
 ***************************************/
$mail->build_message();
/***************************************
 ** Send the email using smtp method.
 ** This is the preferred method of sending.
 ***************************************/
include 'class.smtp.inc';