PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
m-weisel2
Regular
Regular


Joined: May 22, 2005
Posts: 78

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

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


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
m-weisel2
Regular
Regular


Joined: May 22, 2005
Posts: 78

PostPosted: Sat Jul 09, 2005 3:59 pm Reply with quote Back to top

no I will check now
View user's profile Send private message
m-weisel2
Regular
Regular


Joined: May 22, 2005
Posts: 78

PostPosted: Sat Jul 09, 2005 4:03 pm Reply with quote Back to top

nope there is no setting like that.


Max
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sat Jul 09, 2005 5:26 pm Reply with quote Back to top

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)
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
m-weisel2
Regular
Regular


Joined: May 22, 2005
Posts: 78

PostPosted: Sat Jul 09, 2005 7:03 pm Reply with quote Back to top

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


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sat Jul 09, 2005 7:07 pm Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
m-weisel2
Regular
Regular


Joined: May 22, 2005
Posts: 78

PostPosted: Sat Jul 09, 2005 7:47 pm Reply with quote Back to top

well view source is just the html options just has the headers like x-nonspam: none but no character encoding or mime headings
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sat Jul 09, 2005 10:16 pm Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
m-weisel2
Regular
Regular


Joined: May 22, 2005
Posts: 78

PostPosted: Sat Jul 09, 2005 11:13 pm Reply with quote Back to top

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
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum