Limodou
The other two methods that are worth explaining are print_mail () and Send_mail () and two using the $force parameter. Print_mail () Outputs the entire message message, and Send_mail () uses the mail () function of PHP (which is now the mainstream development language) to send messages. Optionally, Send_mail () uses an SMTP object and its sending method (specified by the user) to send the message.
Conclusion
Creating a MIME-compliant message is not as complex as it seems, and can be achieved in a fairly simple way. MIME messages can bring a great deal of atmosphere to many sites.
The class we developed above covers the core idea, and it can be expanded, and the only limitation is your imagination. For example, someone can write the detach () function to delete the attachment (the Attach () method of the specified index can return this information).
This mime_mail class can be used to send HTML-based messages that do not need to be transformed, but embedded images cannot be sent;
Topics that require special attention.
However, HTML or a referenced image without images uses an absolute URL or Tags can also be sent using the Mime_mail class. One
An example is as follows:
$html _data = Hello ;
$mime = new Mime_mail ($to, $from, $subject);
$mime->attach ($html _data, "", OCTET, BASE64, INLINE);
$mime->send_mail ();
?>
The recipient of this message will get a black background and a blue "Hello" text message! The
sends complete inline HTML information, along with some other high-level topics that are sent in a MIME-based message, which deserves special consideration and hopefully will be the continuation of this article. The
Mime_mail class, the constant file, and the running instance can download the zip archive here.
http://www.bkjia.com/phpjc/509089.html Span id= "Indexurl" itemprop= "Indexurl" >www.bkjia.com true http://www.bkjia.com/phpjc/509089.html techarticle limodou The other two methods that are worth explaining are print_mail () and Send_mail () and two using the force parameter. Print_mail () Outputs the entire message message, Send_mail () uses PHP (as the current master ...