blob: 2e713882aa8fa1193ecb2b82da2653b1d69afe6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<?php
// Sends an XHTML email with the appropriate headers and the necessary opening and closing for an XHTML document
function xhtmlemail($to,$from,$subj,$cont,$inheads=null) {
global $conf;
if ($from===null) {
$from=$conf['emailfrom'];
}
$heads='MIME-Version: 1.0' . "\r\n";
$heads.='Content-type: text/html; charset=utf-8' . "\r\n";
$heads.='From: '.$from."\r\n";
$heads.='X-Mailer: PHP/'.$conf['title']."\r\n";
if ($inheads!==null) {
$heads.=$inheads."\r\n";
}
$cont='<?xml version="1.0" encoding="utf-8"?>'."\n".'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n".'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'.$cont.'</html>'."\n";
$heads.='Content-length: '.strlen($cont)."\r\n";
debug('mail', $heads.$cont);
return mail($to,$subj,$cont,$heads);
}
?>
|