473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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.

Aug 10 '06 #1
1 1818
rukkie schrieb:
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
Aug 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: J.C. Flores | last post by:
Hello all, First of all, I must state that I'm new to SQL Server, but have been a long-time software guy for quite some time. Please excuse the potential simplicity of the solution to my...
13
by: Andrew | last post by:
I use conditional compiler constants, set through the VBA IDE in Tools, <projectname> Properties, that I refer to throughout my code to control which code is used during development, and which...
3
by: roger beniot | last post by:
I would like to figure out how to detect an IP address change for an XP/Win2K3 machine that is leasing an IP via DHCP (and do it in C#)... Is there any event that indicates an IP address...
10
by: Fabrizio | last post by:
(Sorry for the crosspost, but I really don't know which is the right newsgroup!) Hi all, I try to change the password to a user that as to change the password at first logon: try {
5
by: who be dat? | last post by:
Hello all. I'm writing an application that is writing trace information that can be viewed in trace.axd. I would like to rename this and use a different name specific to my application. I know...
4
by: Shapper | last post by:
Hello, I have this image in my HTML code: <img src="images/en-US/myImage.jpg" /> I want to change the URL using the value of a Session variable. <img src="images/ Session("culture") Value...
4
by: active | last post by:
It appears to me that if I change the Control's client size the controls size does not change to agree with the new size. Does it work like the VB6 ScaleWidth and ScaleHeight? That is after I...
3
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change...
6
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the...
10
by: Hugh | last post by:
Hi there, An existing solution is used to create a new solution. It is easy to change the names of individual forms and modules. However, how to change the name of project folder? Thanks in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.