Php program for sending attachments (2)
<? Php
Class html_mime_mail {
Var $ headers;
Var $ body;
Var $ multipart;
Var $ mime;
Var $ html;
Var $ html_text;
Var $ html_images = array ();
Var $ cids = array ();
Var $ do_html;
Var $ parts = array ();
/***************************************
** Constructor function. Sets the headers
** If supplied.
***************************************/
Function html_mime_mail ($ headers = ''){
$ This-> headers = $ headers;
}
/***************************************
** Adds a html part to the mail.
** Also replaces image names
** Content-id's.
***************************************/
Function add_html ($ html, $ text ){
$ This-> do_html = 1;
$ This-> html = $ html;
$ This-> html_text = $ text;
If (is_array ($ this-> html_images) AND count ($ this-> html_images)> 0 ){
For ($ I = 0; $ I <count ($ this-> html_images); $ I ++ ){
$ This-> html = ereg_replace ($ this-> html_images [$ I] ['name'], 'cid :'. $ this-> html_images [$ I] ['CID'], $ this-> html );
}
}
}
/***************************************
** Builds html part of email.
***************************************/
Function build_html ($ orig_boundary ){
$ Sec_boundary = '= _'. md5 (uniqid (time ()));
$ Thr_boundary = '= _'. md5 (uniqid (time ()));
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.