Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 10th, 2006, 01:15 PM
rukkie
Guest
 
Posts: n/a
Default Change color in php message

I'm having trouble to change the color of a part of a message I'm
putting together in a PHP script.
The built up of the message is as follows :

$message = "Update for Request number: " . $nbr . "\n" .
"Project name: " . $prjname . "\n" .
$yournamestring . $yrname . "\n" .
"Your email address:" . $yremail . "\n" .
"Address on site:". $osaddr . "\n" .
.... ;

Now I want for instance change the color of the entry "Your email
address" and if possible also of the string represented by $yremail (or
only 1 of both), if a certain condition is true (e.g this item is
changed during an update).

I tried several things, such as
"<FONT color=\"red\">Your email address: </FONT>" .
$yremail . "\n" .

but in the email received appears litteraly all what is noted, but no
text in red.

Probably I'm using the wrong quotes or on the wrong place .... Has
anyone already did something similar ? Has anyone some good advice ?

Thanks in advance.

  #2  
Old August 10th, 2006, 01:55 PM
Markus Ernst
Guest
 
Posts: n/a
Default Re: Change color in php message

rukkie schrieb:
Quote:
I'm having trouble to change the color of a part of a message I'm
putting together in a PHP script.
The built up of the message is as follows :
>
$message = "Update for Request number: " . $nbr . "\n" .
"Project name: " . $prjname . "\n" .
$yournamestring . $yrname . "\n" .
"Your email address:" . $yremail . "\n" .
"Address on site:". $osaddr . "\n" .
.... ;
>
Now I want for instance change the color of the entry "Your email
address" and if possible also of the string represented by $yremail (or
only 1 of both), if a certain condition is true (e.g this item is
changed during an update).
>
I tried several things, such as
"<FONT color=\"red\">Your email address: </FONT>" .
$yremail . "\n" .
>
but in the email received appears litteraly all what is noted, but no
text in red.
>
Probably I'm using the wrong quotes or on the wrong place .... Has
anyone already did something similar ? Has anyone some good advice ?
Besides the fact that the FONT tag is deprecated in HTML, your code is
ok for HTML output. As a normal e-mail message is plain text and not
HTML, the e-mail client will rather display your code as a text string,
instead of interpreting it as HTML.

You can send HTML e-mail; there are ready-to-use classes available, for
example PEAR Mail (pear.php.net); you will find more of them by googling.

HTH
Markus
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles