PHP contact form issues- no line breaks in Outlook!

Discussion in 'PHP' started by jag64551, Jul 26, 2007.

  1. #1
    I am trying to create a PHP contact form, and I have it to where it is sending the email to the specified account. The only problem is that in both Outlook 2003, and 2007, there are no line breaks between the fields. It all runs together in one block, like so:

    Joe, John has submitted the Web Contact Form and provided the following information. contactname: Test organization: Test contactaddress: Test city: Test state: Test zip: Test phone: Test email: test@test.com iam: A Professor iamother: Test feedback: Test

    The part of the code I am using to form the message, looks something like this (except with appropriate field names):

    //===================================================================
    // Custom Email Message (when $autoemailtext is set to false)
    //===================================================================
    $body = $body . "Name: " . $_REQUEST['contactname'] . "\r\n";
    $body = $body . "Address: " . $_REQUEST['address'] . "\r\n";
    $body = $body . "C/S/Z: " . $_REQUEST['csz'] . "\r\n";
    $body = $body . "Email: " . $_REQUEST['email'] . "\r\n";
    $body = $body . "Phone: " . $_REQUEST['phone'] . "\r\n";
    $body = $body . "Feedback: " . $_REQUEST['feedback'] . "\r\n\r\n";


    //===================================================================

    What am I doing wrong?
     
    jag64551, Jul 26, 2007 IP
  2. pruad

    pruad Peon

    Messages:
    71
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How do you send $body? As plain text or as html? If html then you need to use "<br>"
     
    pruad, Jul 26, 2007 IP