[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.

Question
[x]
Attachment Details

php mail html

Asked by Abendago in PHP and Databases, PHP Scripting Language, PHP for Windows

Tags: php, html, mail

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);
[+][-]11/04/09 09:48 PM, ID: 25747036Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 11:55 PM, ID: 25747468Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/05/09 01:59 AM, ID: 25747973Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/05/09 10:36 AM, ID: 25752437Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/05/09 10:09 PM, ID: 25756936Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 11:33 PM, ID: 25765327Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625