1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP mail function

Discussion in 'PHP' started by vijaykoul, Apr 30, 2005.

  1. #1
    Hi frnds,

    I am in a deep problem.
    i am using php mail() function.
    what i want is that the content that is received by the recepient, be received in a formatted way.

    i tried a lot, but was nopt able to sort it out
    i want some <br> tags and some spaces to be put between two different sentences.

    i hope, i am clear.

    how can i do that

    i really need it very quickly...

    please help

    Thanks in Advance
     
    vijaykoul, Apr 30, 2005 IP
  2. TommyD

    TommyD Peon

    Messages:
    1,397
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #2
    \r\n


    This should give you are new line,

    hth,

    tom
     
    TommyD, Apr 30, 2005 IP
  3. norfstar

    norfstar Peon

    Messages:
    1,154
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #3
    And the \r\n needs to be between double quotes (") not single quotes (').
     
    norfstar, Apr 30, 2005 IP
  4. vijaykoul

    vijaykoul Guest

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi frnds,

    The solution that has been given is not working

    what i am doing is i am putting some content into a variable and passing theat variable to the mail function as an argument.

    I have even put "\r\n", but it is not working.

    Any other solution
    thanks in advance
     
    vijaykoul, May 2, 2005 IP
  5. JoeO

    JoeO Peon

    Messages:
    431
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can send the e-mail as HTML and then use <br>

    mail ("MIME-Version: 1.0\n"."Content-type: text/html; charset=iso-8859-1");
     
    JoeO, May 2, 2005 IP
  6. palespyder

    palespyder Psycho Ninja

    Messages:
    1,254
    Likes Received:
    98
    Best Answers:
    0
    Trophy Points:
    168
    #6
    vijaykoul,
    post your code so we can see the problem, it's also easier for us to help you if we know what the context is that your using the mail() function.
     
    palespyder, May 2, 2005 IP
  7. TommyD

    TommyD Peon

    Messages:
    1,397
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #7
    In order to put spaces between sentances, you might need to repeat the return/new line code a few times.

    tom
     
    TommyD, May 2, 2005 IP