PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
webfinearts
Forum Newbie
Posts: 12 Joined: Tue Sep 30, 2003 12:02 pm
Contact:
Post
by webfinearts » Tue Sep 30, 2003 12:02 pm
I tried to send HTML emails including following lines in the header:
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
But what i receive is a plain text of the email (including the html code).
If is possible please just post also a working email class. I will appreciate that a lot
.
philippgerard
Forum Newbie
Posts: 6 Joined: Tue Sep 30, 2003 1:17 pm
Contact:
Post
by philippgerard » Tue Sep 30, 2003 1:21 pm
Code: Select all
<?php
$message = "<h1>Hello world!<h1>";
$to = "empfaenger@system.de";
$subject = "Betrefftext";
$xtra = "From: ab@sender.de (Ab Sender)\r\n";
$xtra .= "Content-Type: text/html\r\nContent-Transfer-Encoding: 8bit\r\n";
$xtra .= "X-Mailer: PHP ". phpversion();
mail($to,
$subject,
$message,
$xtra);
?>
webfinearts
Forum Newbie
Posts: 12 Joined: Tue Sep 30, 2003 12:02 pm
Contact:
Post
by webfinearts » Tue Sep 30, 2003 2:01 pm
Can you explain me that encoding line?
webfinearts
Forum Newbie
Posts: 12 Joined: Tue Sep 30, 2003 12:02 pm
Contact:
Post
by webfinearts » Tue Sep 30, 2003 2:05 pm
Look what he gave me:
Content-Type: text/html
Content-Transfer-Encoding: 8bit
From: Birthday Reminder <
birthday@example.com >
<html>
<head>
and here the html code
webfinearts
Forum Newbie
Posts: 12 Joined: Tue Sep 30, 2003 12:02 pm
Contact:
Post
by webfinearts » Tue Sep 30, 2003 2:12 pm
Is displayng me every time this line:
Content-Transfer-Encoding: 8bit X-Mailer: PHP 4.2.2
My problem is that i do not know what's happening
. Damn i'm a great newbie
Derfel Cadarn
Forum Contributor
Posts: 193 Joined: Thu Jul 17, 2003 12:02 pm
Location: Berlin, Germany
Post
by Derfel Cadarn » Wed Oct 01, 2003 7:24 am
ehm, i suppose you didn't switch off the ability to receive e-mails in HTML-format in your mail-programm, did you?
That would be
my newbie-mistake !
Edit: The script from philippgerard seems to work for me.
philippgerard
Forum Newbie
Posts: 6 Joined: Tue Sep 30, 2003 1:17 pm
Contact:
Post
by philippgerard » Wed Oct 01, 2003 8:50 am
sure it does
I only post wrong code when asking you guzs to find
my bugs
guess your mailprog sucks. allow it to display html should work.
webfinearts
Forum Newbie
Posts: 12 Joined: Tue Sep 30, 2003 12:02 pm
Contact:
Post
by webfinearts » Wed Oct 01, 2003 9:25 am
hm no
Because eerything seems to be ok now, only that line.
The funny thing is that if i'm deleting it the next line above that is displayed.
jayr517
Forum Commoner
Posts: 26 Joined: Fri Aug 22, 2003 7:28 pm
Location: Boise, ID
Contact:
Post
by jayr517 » Wed Oct 01, 2003 9:48 am
The funny thing is that if i'm deleting it the next line above that is displayed.
Can you post the code you're having a problem with? I know philip posted the code you're using, but sometimes a syntax or logic error can sneak in while you're formatting, modifying, deleting etc, etc, etc...