php mail

Busy's picture

He has: 6,151 posts

Joined: May 2001

I found this basic feedback form ages ago on the web (cant remember where, and finally tried it, didnt work Sad, code is:

<?php

mail
( "[email protected]", "Feedback Form Results", $message, "From: $email" );
header( "Location: <a href="http://www.yourdomain.com/thankyou.html" class="bb-url">http://www.yourdomain.com/thankyou.html</a>" );
?>

with my details, comes up error as:

Warning: Failed to Connect in c:\phpdev\www\web pages\test\sendmail.php on line 2

Warning: Cannot add header information - headers already sent by (output started at c:\phpdev\www\web pages\test\sendmail.php:3) in c:\phpdev\www\web pages\test\sendmail.php on line 3

any ideas, could it be my mail options from php.ini ? they are all default

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

yes, check your php.ini

Busy's picture

He has: 6,151 posts

Joined: May 2001

checked c:/windows/php.ini (have 4 php.ini on here), added smtp and sendmail_from,

mail works now but still get the forwarding error, well only get the one error now, the cannot add header info one

forgot to mention it was from my home pc Smiling

Busy's picture

He has: 6,151 posts

Joined: May 2001

Fixed the header location bit now as well, problem was a comment above the referer

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.