Click to See Complete Forum and Search --> : Mail.php error


svenicsale
06-10-2003, 08:41 AM
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");
?>

AdamGundry
06-10-2003, 10:03 AM
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

dovlasr
03-18-2008, 11:05 AM
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..

dovlasr
03-18-2008, 11:37 AM
also, this topic here contains URLs that contain my personal info, so please delete them as well..

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

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

Kor
04-03-2008, 02:32 AM
also, this topic here contains URLs that contain my personal info, so please delete them as well..

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

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