mail() sends the message as .txt file
<p>I'm pretty new to PHP so don't mind the <code>@</code>... was a quick fix for opening the script without errors</p>

<p>I'm currently working on a mail script and its working pretty well.
Sadly it sends the text the user enters as a <code>.txt</code> file instead of plain text</p>

<p>Basically the form is stored in <code>messenger_mailsend.php</code> and the content of the Textarea gets to <code>messenger_mailsend_controller.php</code> by using <code>$_POST[]</code>.</p>

<pre><code>    @$inhalt = $_POST['inhalt'];
    $message = strip_tags($inhalt);

    if(isset($_POST['submit'])){
    @mail($mailto, $subject, 'why not zoidberg?', $headers); 
    echo 'The mail was sent!';
    }
</code></pre>

<p>'why not zoidberg' is the test text i used to check if theres sth wrong with the var, actually it says <code>mail($mailto, $subject, $message, $headers);</code></p>

<p>is the code I use to get the typed message from the form, remove the tags and store it as <code>$message</code>.</p>

<p>If I do a <code>var_dump</code> it says 'I am content' (what was typed in the form).. 
when the <code>$message</code> var is replaced by some plain text it still gets sent as <code>TEXT.txt</code></p>

<p>The code i use for the $headers is: </p>

<pre><code>    $headers .= 'From:' . $usrmail . "\n";
$headers .= 'Reply-To:' . $reply . "\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\n";
$headers .= 'X-Sender-IP:' . $_SERVER['REMOTE_ADDR'] . "\n";
$headers .= 'Content-type: text/html; charset=ISO-8859-1\r\n';

$headers .= 'Cc: ' . $cc . "\n";
$headers .= 'Bcc: ' . $bcc . "\n";
</code></pre>

<p>-- Solution: By setting the content-type to text/plain it works, thanks anyone! --</p>
