Hey, viser den ingen formatering overhoved?
Er html tags'ne synlige?
Evt. prøv dig frem med dette:
$eol = "\n";
$message = get_HTML_email_with_valid_formatting();
$headers = "MIME-Version: 1.0".$eol;
$headers .= "Content-Type: text/html; charset=UTF-8".$eol;
$headers .= "From: example.com <info@example.com>".$eol;
$headers .= "Reply-To: donotreply@example.com".$eol;
mail('me@example.com', 'test', $message, $headers);
eller måske en mere færdig løsning:
function mail_with_attachment($mailto, $subject, $message, $attachmment_content, $filename) {
$content = chunk_split(base64_encode($attachmment_content));
$header = "MIME-Version: 1.0
From: Name
Content-Type: multipart/mixed; boundary=0016e6d78553954dae047ca714d4
--0016e6d78553954dae047ca714d4
Content-Type: multipart/alternative; boundary=0016e6d78553954da9047ca714d2
--0016e6d78553954da9047ca714d2
Content-Type: text/plain; charset=ISO-8859-1
{$message}
--0016e6d78553954da9047ca714d2
Content-Type: text/html; charset=ISO-8859-1
{$message}
--0016e6d78553954da9047ca714d2--
--0016e6d78553954dae047ca714d4
Content-Type: text/plain; charset=US-ASCII; name=\"{$filename}\"
Content-Disposition: attachment; filename=\"{$filename}\"
Content-Transfer-Encoding: base64
{$content}
--0016e6d78553954dae047ca714d4--
";
if (mail($mailto, $subject, "", $header)) {
echo "OK";
} else {
echo "ERROR";
}
}
Indlæg senest redigeret d. 21.08.2010 19:26 af Bruger #14181