Problems with mail function

Discussion in 'PHP' started by acelsodd, Mar 24, 2008.

  1. #1
    Hi,
    I'm new to PHP and I'm trying to use the mail($to,$subject,$message) function, and I have this problem:

    I have a form to colect the data to send in the e-mail where the message variable is got from a textarea.
    After getting the data, I submit it in POST mode to another page where I show the values and I ask for a confirmation from the user before sending the e-mail.
    Everything goes fine only if the textarea field contains only a single line. If I type multiple lines, the send doesn't work in the right way.
    As I said, as I'm new in PHP, I guess the problem is a very simple one.
    Can anyone explain it to me?
    Tks!
    Anthony
     
    acelsodd, Mar 24, 2008 IP
  2. clinton

    clinton Well-Known Member

    Messages:
    2,166
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    110
    #2
    some mail, such as gmail, hotmail etc. are very touchy when it comes to putting \r and \n in the headers or the body text. Try sending it to a few different mail clients, etc. gmail, yahoo, hotmail.

    Read this documentation very carefully, it has a lot of details that might be of use to you:)
    http://ca.php.net/manual/en/function.mail.php
     
    clinton, Mar 24, 2008 IP