|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by Abendago in PHP and Databases, PHP Scripting Language, PHP for Windows
what is wrong with my headers below... my email does not show up html encoded.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
|
// Standar Header
$crlf = chr(10) . chr(13);
$headers = "To: {$to}" . $crlf;
$headers .= "From: {$from}" . $crlf;
$headers .= "Return-Path: " . (($reply)? $from : substr_replace($from, "noreply", 0, strpos($from, '@'))) . $crlf;
$headers .= 'Reply-To: ' .(($reply)? $from : substr_replace($from, "noreply", 0, strpos($from, '@'))) . $crlf;
$headers .= 'X-Mailer: PHP/' . phpversion() . $crlf;
// MIME boundary
$separatore = 'PHP' . md5(uniqid(time()));
// MIME Header
$headers .= 'MIME-Version: 1.0' . $crlf;
switch ($type){
case 'html' :
// Header for client non MIME compatible
$headers .= 'Content-Type: text/html; charset=ISO-8859-15' . $crlf;
$headers .= 'Content-Transfer-Encoding: 7bit' . $crlf;
$messaggio .= "\n{$contenuto}\n";
break;
case 'both' :
$headers .= "Content-Type: multipart/alternative;\n\tboundary=\"" . $separatore . '"' . $crlf;
// Create message for no mime client
$messaggio .= "This is a multi-part message in MIME format.\nIf you are reading this, consider upgrading your e-mail client to a MIME-compatible client.\n";
$messaggio .= "\n--{$separatore}\n";
$messaggio .= "Content-Type: text/plain; charset=ISO-8859-15\n";
$messaggio .= "Content-Transfer-Encoding: 7bit\n\n";
case 'text' :
$messaggio .= strip_tags($contenuto);
if ($type == 'both') {
$messaggio .= "\n--{$separatore}\n";;
$messaggio .= "Content-Type: text/html; charset=ISO-8859-15\n";
$messaggio .= "Content-Transfer-Encoding: 7bit\n";
$messaggio .= "\n{$contenuto}";
$messaggio .= "\n--{$separatore}\n";
}
}
// Send MAIL
return mail($to, $oggetto, $messaggio, $headers);
|
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625