Form mail with long string to sent gives tags in mail

Discussion in 'PHP' started by lampie1978, Oct 3, 2007.

  1. #1
    Hi all,

    Working on this stupid problem i have with sending a mail from a form i build.
    Everything works correctly, but the received mail continously gives me the <br/>-tag within the text.

    Here is my code:
    
    $bericht = "Geachte $vnaam,\n\nDoor het bestuur van svFiladelfia is er voor jou een inlog account aangemaakt voor onze website www.svfiladelfia.nl. Via de website kan je op de hoogte blijven van de meest recente ontwikkelingen, je eigen gegevens beheren en je meest actuele schietstanden bekijken.\nDus kom gauw een kijkje nemen op onze website.\nHiervoor heb je je KNSA nummer nodig en je start wachtwoord is: Welkom.\n\nMet vriendelijke groeten,\nHet bestuur van svFiladelfia.\n\nP.S. op dit mailtje kunt u geen reply sturen.";
    
    $verstuur = nl2br($bericht);
    $scherm = print(nl2br($bericht));
    mail("$email", "svFiladelfia account", "$verstuur" , "From: svFiladelfia" );
    
    PHP:
    The $scherm gives me the following output on screen (just like i wish it 2 be in the e-mail the form sent):
    [​IMG]

    But instead i get the following e-mail from the form:
    
    Geachte test,<br />
    <br />
    Door het bestuur van svFiladelfia is er voor jou een inlog account aangemaakt voor onze website www.svfiladelfia.nl. Via de website kan je op de hoogte blijven van de meest recente ontwikkelingen, je eigen gegevens beheren en je meest actuele schietstanden bekijken.<br />
    Dus kom gauw een kijkje nemen op onze website.<br />
    Hiervoor heb je je KNSA nummer nodig en je start wachtwoord is: Welkom.<br />
    <br />
    Met vriendelijke groeten,<br />
    Het bestuur van svFiladelfia.<br />
    <br />
    P.S. op dit mailtje kunt u geen reply sturen.
    
    HTML:
    Does anyone know how to get rid of the <br /> tags in the e-mail.

    Thanxs in advance.
    Lampie1978
     
    lampie1978, Oct 3, 2007 IP
  2. hemlata

    hemlata Peon

    Messages:
    18
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello,

    Simply modify the code to read the content directly. ie.

    $verstuur = $bericht;
    PHP:
    instead of..

    $verstuur = nl2br($bericht);
    PHP:
    Read http://in2.php.net/manual/en/function.nl2br.php to know when to use function nl2br..

    Hope this will solve your issue.

    Regards,
     
    hemlata, Oct 3, 2007 IP
  3. lampie1978

    lampie1978 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hemlata,

    thnxs tried it and it worked.
    thought i allready used that option, but guess not.
    now i can start finishing the site.
     
    lampie1978, Oct 18, 2007 IP