-1

how to create an wysiwyg html editor in <textarea name="sender_message"></textarea> is it possible when send an email from a php form?

Edited by Ezzaral: Removed fake sig links

2
Contributors
4
Replies
12
Views
6 Years
Discussion Span
Last Post by rakibtg
0

Can you give a little more detail?

I'm not sure if you're wanting to fill in an HTML email with data from a form, or use a field in a form to create an HTML document, or use some kind of drag and drop HTML editor.

You could do something like:
(thisfile.php)

<!-- put your own header stuff above this line, use your imagination -->
<body>
<?php
if (isset($_POST['submit']))
 {
 echo $_POST['sender_message'];
 }
if (isset($_POST['post']))
 {
 // put your email code here.
 }
?>
<hr /><hr />
<form action='thisfile.php' method='post'>
<textarea name="sender_message">$message</textarea>
<input type='submit' name='submit' value="View" />
<input type='submit' name='post' value="Post Email" />
</body>

I don't know, anyone else have a better solution?

David

Edited by dietdew12z: Guessing at what you mean.

0

Oops, I forgot a major part of that.

In order to send HTML as email you have to put some additional info in your email headers.

$headers = "From: no-reply@placelogo.com \r\n";  // replace with your email address
  $headers .= "Reply-To: no-reply@placelogo.com \r\n";
  $headers .= "MIME-Version: 1.0 \r\n";
  $headers .= "Content-Type: text/html; charset=ISO-8859-1 \r\n";
  $emailto = "addressee@whereever.com";            // replace with the addressee
  $subject = "Subject of email";                   // replace with the subject line
  mail($emailto,$subject,$message,$headers);

David

Edited by dietdew12z: n/a

0

Wrong:

<textarea name="sender_message">$message</textarea>

Right:

<textarea name="sender_message"><?php echo $message; ?></textarea>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.