Page 1 of 1

Sendmail.php on testserver

Posted: Wed Nov 17, 2010 5:45 pm
by monstaink
I have got my apache 2.2 and php working no problem to deal with .php files

i'm trying to do a simple feedbackform from the tutorial i'm doing

I have set php.ini with the following lines
[mail function]
SMTP = mail.talktalk.net
smtp_port = 25
sendmail_from = "myemail"@talktalk.net

i have 3 basic files
feedback.html wich puts up an email box and message box and subit button
sendmail.php which is coded as follows
<?php
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "myemail@talktalk.net", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://localhost/basic/thankyou.html" );
?>

and a simple thanx for the thankyou.html

"NOTE: i have changed myemail and left the talktlak prt in so i don't recieve masses of junkmail"

Now when i send the feedback form i get the tankyou screen but recive non of the test emails. anyone got any ideas where i'm going wrong

Thnax all

Re: Sendmail.php on testserver

Posted: Wed Nov 17, 2010 5:55 pm
by Jonah Bron
Remove the header redirect, and see if you get errors. Make sure you have errors enabled in your php.ini.

Re: Sendmail.php on testserver

Posted: Wed Nov 17, 2010 6:08 pm
by monstaink
Hi

Thanx for the speedy reply i belive i have errors turned on,
display_errors = On in php.ini

as for header redirect where do i find that its not in php,ini that i can find

Thanx
keith

Re: Sendmail.php on testserver

Posted: Wed Nov 17, 2010 6:32 pm
by Jonah Bron
No, the header redirect in your code (the second page).

Re: Sendmail.php on testserver

Posted: Wed Nov 17, 2010 6:45 pm
by monstaink
i'm bad didn't even see that in there

sorry m8 and thanx i'm learning

regards

Re: Sendmail.php on testserver

Posted: Wed Nov 17, 2010 6:56 pm
by monstaink
hi johan
removed the header line so now reads
<?php
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "mrrowell@talktalk.net", "Feedback Form Results",
$message, "From: $email" );
?>

opened my feedback html again a simple file
<form method="post" action="sendmail.php">
Email: <input name="email" type="text" /><br />
Message:<br />
<textarea name="message" rows="15" cols="40">
</textarea><br />
<input type="submit" />
</form>

put a real email adress in and a mesage test page
hit sumbit but i don't recieve the feedback form inmy inbox

and before i go anyfurther with my form i need to know i got it wher eit comes back to be able to check it does what i want

Thanx for your help so far

regards
keith

Re: Sendmail.php on testserver

Posted: Wed Nov 17, 2010 9:57 pm
by Jonah Bron
monstaink wrote:put a real email adress in and a mesage test page
hit sumbit but i don't recieve the feedback form inmy inbox
Sounds like you're saying it still doesn't work. Check your spam box.
monstaink wrote:and before i go anyfurther with my form i need to know i got it wher eit comes back to be able to check it does what i want
Sorry, I have no idea what that means.