Heyes
?
Error_reporting (63);
Include (' Class.html_mime_mail.inc ');
/***************************************
* * Example of usage.
***************************************/
/***************************************
* * Read the file background.gif into
* * $backgrnd.
***************************************/
$filename = ' background.gif ';
$backgrnd = fread ($fp = fopen ($filename, ' R '), FileSize ($filename));
Fclose ($FP);
/***************************************
* * Read the file test.zip into $attachment.
***************************************/
$filename = ' Example.zip ';
$attachment = fread ($fp = fopen ($filename, ' R '), FileSize ($filename));
Fclose ($FP);
/***************************************
* * Create the Mail object. Optional headers
* * argument. Don't put From:here, this
* * 'll is added when $mail->send
***************************************/
$mail = new Html_mime_mail ("x-mailer:html MIME Mail class\r\n");
/***************************************
* * If sending an HTML email, then
* * Two variables specify the text and
* * HTML versions of the mail. Don ' t
* * have to is named as these are. Just
* * Make sure the names tie into to the
* * $mail->add_html () command further down.
***************************************/
$text = ' This is a test. ';
$html = '
/***************************************
* * ADD the text, HTML and embedded images.
* * Each embedded image has to is 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 ($backgrnd, ' background.gif ', ' image/gif ');
$mail->add_html ($html, $text);
/***************************************
* * If not sending an HTML email, then
* * is used to set the plain text
* * Body of the email.
***************************************/
$mail->body = ' fsss ';
/***************************************
* * is used to add a attachment to
* * the email.
***************************************/
$mail->add_attachment ($attachment, ' example.zip ', ' application/octet-stream ');
/***************************************
* * builds the message.
***************************************/
$mail->build_message ();
/***************************************
* * sends the message. $mail->build_message ()
* * is seperate to $mail->send
* * Same email can be sent many
* * Differing recipients simply by putting
* * $mail->send () in a loop.
***************************************/
$mail->send (', ' szw@phpexe.com ', ' from Name ', ' szw@phpexe.com ', ' Subject ', ');
/***************************************
* * Debug stuff. Entirely unnecessary.
***************************************/
Echo ' <PRE> ';
Echo $mail->mime;
Echo ' </PRE> ';
?>