Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

HTML email using PHP

 
   Database Forums (Home) -> PHP RSS
Next:  Webspeed  
Author Message
Zoe Brown

External


Since: Sep 08, 2005
Posts: 8



(Msg. 1) Posted: Mon Oct 17, 2005 9:55 am
Post subject: HTML email using PHP
Archived from groups: alt>php (more info?)

Hello

How do i send a HTML email using PHP.

I have tried loads of examples and they are not working.

last example was

<?php

$to = blabla.DeleteThis@bla.net;

$subject = 'Wakeup bob!';

$message = '<b>yo</b>, whassup?';

$headers = "From: server.DeleteThis@barnyard.com\r\n" .

'X-Mailer: PHP/' . phpversion() . "\r\n" .

"MIME-Version: 1.0\r\n" .

"Content-Type: text/html; charset=utf-8\r\n" .

"Content-Transfer-Encoding: 8bit\r\n\r\n";

// Send

mail($to, $subject, $message, $headers);

?>

 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Geoff Berrow1

External


Since: Dec 24, 2003
Posts: 145



(Msg. 2) Posted: Mon Oct 17, 2005 10:55 am
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I noticed that Message-ID:
from Zoe Brown contained the following:

>How do i send a HTML email using PHP.

Don't. All html email is spam.

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011

 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Nicholas

External


Since: Oct 10, 2005
Posts: 3



(Msg. 3) Posted: Mon Oct 17, 2005 10:55 am
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

>>How do i send a HTML email using PHP.
>
> Don't. All html email is spam.

Do you have more quotes like this?
 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Zoe Brown

External


Since: Sep 08, 2005
Posts: 8



(Msg. 4) Posted: Mon Oct 17, 2005 12:55 pm
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Geoff Berrow" wrote in message

>I noticed that Message-ID:
> from Zoe Brown contained the following:
>
>>How do i send a HTML email using PHP.
>
> Don't. All html email is spam.

so what do you suggest instead, I need to be able to format the document on
the server and then send.
>
> --
> Geoff Berrow 0110001001101100010000000110
> 001101101011011001000110111101100111001011
> 100110001101101111001011100111010101101011
 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Geoff Berrow1

External


Since: Dec 24, 2003
Posts: 145



(Msg. 5) Posted: Mon Oct 17, 2005 3:55 pm
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I noticed that Message-ID:
from Nicholas contained the following:

>> Don't. All html email is spam.
>
>Do you have more quotes like this?

Well it is as far as I am concerned and I'm not alone. And unless it
also has a plain text alternative I won't even see it.
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Zoe Brown

External


Since: Sep 08, 2005
Posts: 8



(Msg. 6) Posted: Mon Oct 17, 2005 5:55 pm
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> That's not a troll; it is actually some good advice although rather
> blunt and uninformative. I do not open email containing HTML. It goes
> directly to my bozo bin. I assume I'm not alone in this. I prefer to
> read mail in plain text without *your* choice of horrid text and
> background colors; without the awfully sized text jumping off the
> screen at me.
>
Its not my choice, this is a form to be emailed only to a client who wants
to have it look a certain way.
 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Zoe Brown

External


Since: Sep 08, 2005
Posts: 8



(Msg. 7) Posted: Tue Oct 18, 2005 2:55 am
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> I understand that; unfortunately, clients don't always want to do it
> the "right" way. The *your* in my quote above wasn't intended to be
> you, or anyone else in particular, just whoever chooses some of the
> awful stuff I've seen. Maybe send your client (anonymously, of course)
> a few emails with hot pink backgrounds and 200px tall lime green text?

do I have any other options ? At the end of the day they have a paper
version of an order form and they want this to be completed online by the
customer and then something as close to the paper form emailed to them.

Also - would you have any idea's why I dont seem to be able to send HTML to
outlook express, the headers in the document are just being treated as text.
 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Steve222

External


Since: Sep 20, 2004
Posts: 51



(Msg. 8) Posted: Tue Oct 18, 2005 10:41 am
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> "Content-Transfer-Encoding: 8bit\r\n\r\n";

Re: problems with Outlook Express, OE may be confused by your extra
CRLF in the header. Don't do this, let PHP sort out the break between
header and body.

---
Steve
 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
jj

External


Since: Jul 14, 2005
Posts: 1



(Msg. 9) Posted: Tue Oct 18, 2005 1:08 pm
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You then must miss alot of important emails as outlook which is probably the
most popular email software by default sends all emails as HTML. You have to
manually set it to send in plain text which I know for a fact 90% of users
wouldnt even know how to do.



"Geoff Berrow" wrote in message

> I noticed that Message-ID:
> from Nicholas contained the following:
>
> >> Don't. All html email is spam.
> >
> >Do you have more quotes like this?
>
> Well it is as far as I am concerned and I'm not alone. And unless it
> also has a plain text alternative I won't even see it.
> --
> Geoff Berrow 0110001001101100010000000110
> 001101101011011001000110111101100111001011
> 100110001101101111001011100111010101101011
 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Tobierre

External


Since: Oct 16, 2005
Posts: 1



(Msg. 10) Posted: Tue Oct 18, 2005 5:55 pm
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Zoe,

Sorry to see that your simple request for help has turned in to a pissing
match by others...

Both HTML and Plain Text mail have their strong points and seeing as 95% of
most mail viewers can cope with either, it's left down to the individual
users preferences, as to which they wish to receive.

From my own experience of sending a quarterly newsletter to 20000
subscribers only 1,500 have chosen the plain text version!!! Down from
about 4000 a couple of years ago.

Try the following snip it below it works for me...

$Recipient = "Test Message ";
$Subject = "Test HTML Message";
$Message = "<HTML><STRONG style=\"background: #FFFD33; font-size:
large;\">This is a test message to see if HTML sending
works!</STRONG></HTML> \n";

$Headers = "FROM: Test Message \r\n";
$Headers .= "Reply-To: Test Message \r\n";
$Headers .= "Return-Path: Test Message \r\n";
$Headers .= "X-Priority: 1\r\n"; //1 is important 3 is normal
$Headers .= "X-MSMail-Priority: High\r\n";
$Headers .= "X-Sender: Test Message \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";
$Headers .= "Content-Transfer-Encoding: 8bit\r\n";

mail("$Recipient, $Subject, $Message, $Headers");
 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Zoe Brown

External


Since: Sep 08, 2005
Posts: 8



(Msg. 11) Posted: Wed Oct 19, 2005 10:55 am
Post subject: Re: HTML email using PHP [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> $Headers = "FROM: Test Message \r\n";
> $Headers .= "Reply-To: Test Message \r\n";
> $Headers .= "Return-Path: Test Message \r\n";
> $Headers .= "X-Priority: 1\r\n"; //1 is important 3 is normal
> $Headers .= "X-MSMail-Priority: High\r\n";
> $Headers .= "X-Sender: Test Message \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";
> $Headers .= "Content-Transfer-Encoding: 8bit\r\n";

thanks loads, I have got this working now I was having string concatenation
issues as I am new to PHP, but it works now.

Its nice to know that the HTML approach I am using is OK. This is not a
news letter but an order confirmation and I know the configuration of the
email client that particular address is using so I know it will be fine.

Thanks again.
 >> Stay informed about: HTML email using PHP 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
PHP create HTML email inserts '!'s - OK, I'm trying to create an email and when it sends the email, it mostly works except that there are '!' inserted at some spots. Checking the html source of the email, looks like they are placed at the end of long lines. I'm assuming there is some..

Using pop3.class.inc to read email server + retrieve new e.. - Hello, use pop3.class.inc found here (http://www.phpclasses.org/ browse/file/3925.html) to connect to my email server and to retrieve new emails. The function also look at attachment and save the file on a folder. Problem, the image files copied on the....

<<<HTML - Let us say I have lots of html-code I want to print.... surrounded by php code. I learned once that I could do like this: <?php $name = empty($_POST['name'] ? "" : $_POST['name']; print <<<HTML <form method="post" act...

PHP/HTML - Hope there is someone out there how can help me. I got a small problem, as you will properly see i'm a newbi. I'm running php 5.1.2 and apacheserver 2.0.55 on a winxp installation. The following code is not displaying anything in the browser: <?php...

PHP in html - Hello, I have a php include command in my website and the script shows up. However, I need for the script to show up on the right side of page (there is enough room there)... but for some reason it shows up at the bottom. I placed the include command...
   Database Forums (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can 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



[ Contact us | Terms of Service/Privacy Policy ]