Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
m-weisel2
Regular
Regular


Joined: May 22, 2005
Posts: 78

PostPosted: Fri Jul 08, 2005 10:03 am Reply with quote

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! 
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Fri Jul 08, 2005 10:59 pm Reply with quote

I don't use Outlook but have you checked to see if you have told Outlook to display HTML in some setting in Options?
 
View user's profile Send private message
m-weisel2
PostPosted: Sat Jul 09, 2005 3:59 pm Reply with quote

no I will check now
 
m-weisel2
PostPosted: Sat Jul 09, 2005 4:03 pm Reply with quote

nope there is no setting like that.


Max
 
Raven
PostPosted: Sat Jul 09, 2005 5:26 pm Reply with quote

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 Wink (This really should be the #1 in this list. Then the rest become of no value)
 
m-weisel2
PostPosted: Sat Jul 09, 2005 7:03 pm Reply with quote

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
PostPosted: Sat Jul 09, 2005 7:07 pm Reply with quote

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
PostPosted: Sat Jul 09, 2005 7:47 pm Reply with quote

well view source is just the html options just has the headers like x-nonspam: none but no character encoding or mime headings
 
Raven
PostPosted: Sat Jul 09, 2005 10:16 pm Reply with quote

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
PostPosted: Sat Jul 09, 2005 11:13 pm Reply with quote

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
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©