Author |
Message |
m-weisel2
Regular


Joined: May 22, 2005
Posts: 78
|
Posted:
Fri Jul 08, 2005 10:03 am |
|
ok I am trying to send an html email with the php mail() function. I have some of the scripting right because on my web email client it shows up perfect but in outlook it just shows the html.
here is my code.
Code:// message
$message = "<html><head><title>hello</title></head><body><p>hi</p></body><html>\r\n";
// From Header Format
$fromname = $first_name . " " . $last_name;
// Headers
$headers = "From: \"".$fromname."\" <".$email.">\r\n";
$headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail("$recipient", "$subject", $message, $headers);
//go to thank you page.
header("Location: $redirect");
|
and this is what outlook xp pro shows:
Code:X-Mailer: PHP/5.0.4
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
Message-Id: <20050708160051.111D2110DE5@host.domain.tld>
Date: Fri, 8 Jul 2005 09:00:51 -0700 (MST)
X-Nonspam: None
<html><head><title>hello</title></head><body><p>hi</p></body><html>
|
Can someone tell me why outlook won't take it.
I am using postfix with php 5.0.4 and apache 2.0.54
Max |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Fri Jul 08, 2005 10:59 pm |
|
I don't use Outlook but have you checked to see if you have told Outlook to display HTML in some setting in Options? |
|
|
|
 |
m-weisel2

|
Posted:
Sat Jul 09, 2005 3:59 pm |
|
|
|
 |
m-weisel2

|
Posted:
Sat Jul 09, 2005 4:03 pm |
|
nope there is no setting like that.
Max |
|
|
|
 |
Raven

|
Posted:
Sat Jul 09, 2005 5:26 pm |
|
Let's try few things.
- First of all, if you double click to open the email in a separate window, does it display correctly?
- Use your mouse/cursor and click in the body of the message to make the pane active. The press Alt-Shift-h to see if that will cause it to display.
- Since Outlook uses IE to display the html message, check your security settings.
- Do any messages display html in Outlook (not just yours, but any at all)? If so, check the headers of that message to see what they may be sending that you are not.
- Scrap IE and Outlook in favor of FireFox and Thunderbird. I did about a month ago and have never looked back nor wanted to (This really should be the #1 in this list. Then the rest become of no value) |
|
|
|
 |
m-weisel2

|
Posted:
Sat Jul 09, 2005 7:03 pm |
|
well none of those steps work and I do use firefox and thunderbird but this is for a design I am doing for another companies website and I have to make it so at least their computers can read it and yes it will display all other html messages but not mine and when I look at it there are no headers because it only displays the html with a view source and only if I could find where the messages are located could I get the headers.
Max |
|
|
|
 |
Raven

|
Posted:
Sat Jul 09, 2005 7:07 pm |
|
Then do a search for it because it can and does display the headers. If you open the message in a separate window and then look in File-Properties or something like that. |
|
|
|
 |
m-weisel2

|
Posted:
Sat Jul 09, 2005 7:47 pm |
|
well view source is just the html options just has the headers like x-nonspam: none but no character encoding or mime headings |
|
|
|
 |
Raven

|
Posted:
Sat Jul 09, 2005 10:16 pm |
|
To display a message's headers in Outlook:
* Open the message in a new window in Outlook.
* Select View | Options... from the message's menu.
All header lines appear under Internet Headers at the bottom of the dialog that comes up. |
|
|
|
 |
m-weisel2

|
Posted:
Sat Jul 09, 2005 11:13 pm |
|
thanks I know that I have those headers but it still doesn't work for me I have a perfect duplicated just it was sent from my server. and outlook won't take it.
Max |
|
|
|
 |
|