Drupal6 hook_mail enables HTML mail sending

Source: Internet
Author: User

Introduction: This is a detailed page for drupal6 hook_mail to send HTML emails. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 341729 'rolling = 'no'> /*
* Implement hook_mail
* $ Key is used to differentiate mail operations.
* $ Message content
* $ Params parameter, if any...
* Call method: drupal_mail ('example ', 'html', 'example @ gmail.com', language_default (), array ('subobject' => '', 'body' => ''))
*/
Function example_mail ($ key, & $ message, $ Params ){
Switch ($ key ){
Case 'html ':
$ Message ['subobject'] = $ Params ['subobject'];
$ Message ['body'] [] = $ Params ['body'];
$ Message ['headers'] = array (
'Mime-version' => '1. 0 ',
'Content-type' => 'text/html; charset = UTF-8; format = flowed ',
'Content-transfer-encoding '=> '8bit ',
'X-mailer' => 'drupal ',
'From' => isset ($ Params ['from'])? $ Params ['from']: variable_get ('site _ name', 'infinity ')
);
Break;
}
}

Love J2EE follow Java Michael Jackson video station JSON online tools

http://biancheng.dnbcw.info/php/341729.html pageno: 6

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.