473,326 Members | 2,023 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,326 software developers and data experts.

Changing text color in a string (email message)

Hello am just a simple question.I have a contact us page that sends mail to the admin, i got it finally working but i was wondering if there is anyway to change the colour of what it sends to the admin.
Here is what it is sending
[PHP]$message = <<<MSG
This message was sent from the contact us page,
The user said,
$_POST[message]
this user has in anyway missused this page please contact an adminstator asap with there ip address $_SERVER[REMOTE_ADDR]
MSG;[/PHP]
I would like to make the $_POST[message] red
Jun 24 '07 #1
7 7992
pbmods
5,821 Expert 4TB
Heya, kenno69.

The easiest way to do this is to use HTML. Just put span tags around the message:

Expand|Select|Wrap|Line Numbers
  1. <span style="color:red;">$_POST[message]</span>
  2.  
For info on how to send HTML emails, check out the manual page for mail(). Look towards the middle of the page.
Jun 24 '07 #2
Thanks, but when i read my email it just shows me
"<span style="color:red;">am testing</span>"
Any other way of sorting that out
Jun 24 '07 #3
pbmods
5,821 Expert 4TB
Changed thread title to better describe the problem.

Heya, kenno69.

For info on how to send HTML emails, check out the manual page for mail(). Look towards the middle of the page.
Jun 24 '07 #4
Thanks, i really cannot see anything to do with changing the colour of the message, i must be blind or something cos i have really searched for it
Jun 24 '07 #5
pbmods
5,821 Expert 4TB
Heya, kenno69.

Thanks, i really cannot see anything to do with changing the colour of the message, i must be blind or something cos i have really searched for it
To use HTML in an email message, you have to send special headers:

Expand|Select|Wrap|Line Numbers
  1. // To send HTML mail, the Content-type header must be set
  2. $headers  = 'MIME-Version: 1.0' . "\r\n";
  3. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  4. .
  5. .
  6. .
  7. // Mail it
  8. mail($to, $subject, $message, $headers);
  9.  
http://www.php.net/manual/en/functio....php#id5066734

This will make the email client evaluate HTML in your email, which will in turn make the text red.

The only exception is if your email client doesn't support HTML emails, or if it has the HTML email option turned off.
Jun 24 '07 #6
Oh i didn't see that bit sorry. Thanks alot tho
Jun 24 '07 #7
pbmods
5,821 Expert 4TB
Heya, kenno69.

No problem. If you run into any further problems, just post 'em, and we'll help you out :)
Jun 24 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Cengiz Ulku | last post by:
Hi all, I know now how to change the font name of a RTF file in a RTB control using, for example: RTextBox1.SelFontName = cmbFonts.Text I have a RTF file -created with Word- displayed in a...
3
by: Pavan Arise | last post by:
Hi all.. This may seem simple..but I am stuck here! I have a frame in which I have a label. I was trying to change the caption of that label via code (I mean at runtime & not design time). But...
12
by: Eli Daniel | last post by:
Hi, I'm new to Python. Can you please tell me if the following is possible. My users are using other scripting launguage to write scripts. They are used to write somthing like (keeping it...
10
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have...
6
by: tshad | last post by:
Is there a way during Page_Load to change or add an attribute to the Body tag? I want to be able to change the onLoad body attribute to do a focus on one of my text boxes, such as: ...
6
by: Ioannis Demetriades | last post by:
Hi, I need to change the printer's font to "control" -a printer font, and then send a sequence of characters to the printer. My problem is that I cannot change the printer's font. Can this be...
4
by: rroman | last post by:
I have a drop downList being populated by a dataSet. My dataSet has the folliwing fields: (id, usersName, emailAddress). My dropDownList has the DataTextField set to usersName and the...
7
by: Sakharam Phapale | last post by:
Hi All, How to preserve the old font properties while changing new one? I posted same question 2 months back, but I had very small time then. eg. "Shopping for" is a text in RichTextBox and...
3
by: Prodian | last post by:
I using the following code to start a process and redirect the output to a rich textbox. This is working fine but now I want to change the font color for certain text lines for example: ...
4
by: wildman | last post by:
RE: Replacing Text without changing case?? This code works great, but case has to be exact. Research.Text = Research.Text.Replace(textboxSearch.Text, "<b>" + textboxSearch.Text + "</b>") ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.