Jump to content

Email submission sends /r/n


EchoFool

Recommended Posts

Hey,

 

I have a submission form to ask for support to my support email. But when i recieve messages the break lines are not counted for and i get the r/n.

 

I then added the nl2br($Message) but that also does not work.... and so im not sure how i solve it ... here is my script:

 

<?php
        If(isset($_POST['Send'])){
            $supportemail ='[email protected]';
            $Username = $_POST['Username'];
            $Email = $_POST['Email'];    
            
            If(strlen($Email)<3){
?>
            Invalid email address!
            <br />
            <a href="index.php">Continue</a>
            <br /><br />
<?php           
            }Else{
            
        $subject = 'I am requesting help!';
        $headers = 'From: '.$Email.' <'.$Email.'>'."\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
        $headers .= 'mailed-by: text/html; charset=iso-8859-1'."\r\n";
            $message = "<b>".ucwords($Username)."</b> has requested help ! <br /><br />";
            $message .= "Their message is: <br /><b>".nl2br($_POST['letter'])."</b> <br /><br />";
            $message .= "Email is: <b>".$Email."</b>";
        mail('$supportemail', $subject, $message, $headers);    
            
            
?>
            Your message has succesfully been sent, you will be contacted by the email "<? echo $Email; ?>" that you have provided as soon as possible!
            <a href="index.php">Continue</a>
            <br /><br />
<?php
            }
?>

 

Hope you can help!

Link to comment
https://forums.phpfreaks.com/topic/214945-email-submission-sends-rn/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.