www.webdeveloper.com
Results 1 to 5 of 5

Thread: Mail.php error

  1. #1
    Join Date
    Jun 2003
    Posts
    42

    Mail.php error

    I recieve this error wehen sending messages using my mail.php form, but I don't know why they occur?


    Warning: Cannot add header information - headers already sent by (output started at /home/*/public_html/proba/mail.php:1) in /home/****/public_html/proba/mail.php on line 10

    THIS IS MY mail.php

    <title>sendmail form</title><?php

    $headers .= "From: $email \n";
    $headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
    $recipient = "myemail@hotmail.com";
    $subject = "Pictures ";
    $msg = wordwrap( $list, $probni, 1024 );
    mail($recipient, $subject, stripslashes($msg), $headers);

    header("location: thanks.php");
    ?>
    Last edited by Kor; 04-03-2008 at 03:31 AM.

  2. #2
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    You can't use header() if you have already sent HTML to the client, which you have in your <title> tag. Remove all HTML before the start of the PHP script, and it should work.

    Adam

  3. #3
    Join Date
    Mar 2008
    Posts
    3
    Could you please delete

    /home/****/public_html/proba/mail.php

    as it reveals personal info to search engines!!! I tried contacting admins but have no right for PMs yet..
    Last edited by Kor; 04-03-2008 at 03:32 AM.

  4. #4
    Join Date
    Mar 2008
    Posts
    3
    also, this topic here contains URLs that contain my personal info, so please delete them as well..

    http://www.webdeveloper.com/forum/sh...ad.php?t=10530

    Sorry for double posting, but Edit didn't work..
    Thank you!

  5. #5
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by dovlasr
    also, this topic here contains URLs that contain my personal info, so please delete them as well..

    http://www.webdeveloper.com/forum/sh...ad.php?t=10530

    Sorry for double posting, but Edit didn't work..
    Thank you!
    OK, done

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles