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