View Full Version : Help With Showing Rendered html in Textarea

06-26-2010, 04:06 PM
Hi All

I have just searched the net trying to find the answer to a small question and haven't actually been able to find a solution, so I am hoping some knowledgeable person here may be able to help :)

I own sites that have a built in admin mass mailer which sends emails out to the sites members via the admin panel.

The mailer page is in php and is set up with textarea boxes/forms.

I would like to be able to send out rendered html in the emails

At the moment if I added this to the email (for example)

<a href="http://www.google.com">Google</a>

It would show up in the received email in code format and not as a link.

I would like to make the code html render so that it doesn't show as the code format.

The code that creates the email content box is:

<td colspan=2 align=\"left\"><textarea cols=50 rows=13 name=\"msg\"></textarea></td>

and the mailer page looks like:


I hope that makes sense and apologies if I used an incorrect terminology I am relatively new to php/html

I look forward to any help or suggestions you may have.

Many Thanks


06-26-2010, 06:30 PM
It's the php code you need to change to allow you to send an html email.

Have a look at example 4 here (http://php.net/manual/en/function.mail.php) or Google php html email for loads of help.

06-26-2010, 07:21 PM
It's the php code you need to change to allow you to send an html email.

Have a look at example 4 here (http://php.net/manual/en/function.mail.php) or Google php html email for loads of help.

Hi thanks for your reply

Sorry thats all a bit confusing to me

So I can't just modify the <textarea> tag to a tag that allows html to be added and rendered?

The mailer system is built into the site script so other than the php file that contains the layout code I wouldn't have a clue what to modify, sorry if I am asking stupid questions

Major Payne
06-27-2010, 06:24 AM
To put HTML code inside a textarea box, you need to change the opening tag "<" to the character entity. It will show the code as text, but will not be any active links, etc., inside the textarea box.

< = & lt ; (remove spaces)

Not sure if that is what you are after. If you want a better email form, may I suggest one of these:

Your current hosting package MUST allow SMTP ( http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol ) to work. Otherwise, no email can be sent.

Use any of the below sites to make the workable form you need:

For making forms:

These are really good online form makers. Just follow the instructions for making it and uploading file(s).

Contact Form Generator: http://www.tele-pro.co.uk/scripts/contact_form/
http://www.jotform.com/?gclid=CNKhqei1wJ4CFRQhnAod6laUqA (WYSIWYG Form Maker)
Ajax - Creating an HTML Form: http://www.tizag.com/ajaxTutorial/ajaxform.php

http://www.reconn.us/content/view/12/34/ (Download - Contact Us Script)

Form Service: http://www.mycontactform.com/
Online Free Tool, PHP Contact Form Code Generator: http://www.htmlbasix.com/contactform.shtml
PHP Mailer Script Step by Step: http://www.htmlgoodies.com/beyond/php/article.php/3855686
PHP Sending E-mails: http://www.w3schools.com/PHP/php_mail.asp

Freebie: Good looking Fluid Contact Form: http://www.flashuser.net/flash-components/freebie-good-looking-flash-contact-form.html

Put an online contact form on your site in about 8 minutes (Requires an account): http://response-o-matic.com/

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum