Help With Showing Rendered html in Textarea |
Help With Showing Rendered html in Textarea |
Holly77 |
Jun 26 2010, 10:11 AM
Post
#1
|
Group: Members Posts: 3 Joined: 26-June 10 Member No.: 12,179 |
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) CODE <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: CODE <tr> <td colspan=2 align=\"left\"><textarea cols=50 rows=13 name=\"msg\"></textarea></td> </tr> 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 Holly |
pandy |
Jun 26 2010, 11:15 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,733 Joined: 9-August 06 Member No.: 6 |
Don't use TEXTAREA to display the message.
"Contents Plain text (including entities)" http://htmlhelp.com/reference/html40/forms/textarea.html That you use a TEXTAREA to write the message in, doesn't mean the other person needs to read it in one. |
Holly77 |
Jun 26 2010, 01:26 PM
Post
#3
|
Group: Members Posts: 3 Joined: 26-June 10 Member No.: 12,179 |
Hi Pandy
Thank you for your reply The message is typed into the textarea and then sent via email and read as an email, the member doesn't see it in the textarea box. I just wondered if there was a different tag I can use other than <textarea> that will allow me to input html into it and then when sent the recipient will see the rendered html in their received email Sorry if the link you have pointed to has the answer but I am quite new to coding and need things directly pointed out to me (sorry) Thanks Holly |
pandy |
Jun 26 2010, 01:40 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,733 Joined: 9-August 06 Member No.: 6 |
Got it. You need to use a scipt/program than can send HTML mail instead of text, or change the script you use so it does that. As it is now your email is probably sent as text/plain ans will be displayed as such by the receiving email client.
|
Holly77 |
Jun 26 2010, 03:24 PM
Post
#5
|
Group: Members Posts: 3 Joined: 26-June 10 Member No.: 12,179 |
Hi
I don't know if this was what you were getting at but I found the 'root' file for the mailer in the script and found that the script had PHPMailer built in and adapted to send mass mails to members, I found the line with: CODE $ContentType = "text/plain"; and changed to CODE $ContentType = "text/html"; and now the mass mailer can process html code and render it into the correct format in the received email Thanks again for your help |
pandy |
Jun 26 2010, 07:22 PM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,733 Joined: 9-August 06 Member No.: 6 |
Not exactly, but the recipient's email client can, because now it knows that it's supposed to. And you're welcome.
|
Lo-Fi Version | Time is now: 27th April 2024 - 10:48 AM |