...

View Full Version : PHP form mailer not working?



sharkey182uk
04-20-2004, 10:31 AM
I am fairly new to PHP and i found an open source form mailer script so that you could send form feedback to your email but it doesnt seem to be working i set the mailer.php file to send to sharkey182uk at hotmail dot com (spam reasons i wrote it like this here) after i have submitted it brings up my thankyou.php file but it doesnt seem to be working correctly. I have tested it a few times but still no luck could anyone please help me out.


Any help is greatly appreciated. :thumbsup:

sidney
04-20-2004, 11:09 AM
i suggest you try with a non hotmail account

hotmail can be funny they block spammers(not saying your a spammer)

but your host may have been blacklisted this is proberbly not there fault

they may have had a customer who abused there servers(they can be removed from list but it takes time

you could also try changing the headers you are sending

ps/ it would be better to post some code as this might help to identify the cause

sharkey182uk
04-20-2004, 11:16 AM
This is my form mailer code here. Yeah i agree it coudl be my host.



<?PHP

#######################################################
# This script is Copyright 2003, Infinity Web Design #
# Distributed by http://www.webdevfaqs.com #
# Written by Ryan Brill - ryan@infinitypages.com #
# All Rights Reserved - Do not remove this notice #
#######################################################

## The lines below need to be edited...

###################### Set up the following variables ######################
#
$to = "sharkey182uk@hotmail.com"; #set address to send form to
$subject = "Feedback Form"; #set the subject line
$headers = "From: Form Mailer"; #set the from address, or any other headers
$forward = 1; # redirect? 1 : yes || 0 : no
$location = "thankyou.php"; #set page to redirect to, if 1 is above
#
##################### No need to edit below this line ###################
###

## set up the time ##

$date = date ("l, F jS, Y");
$time = date ("h:i A");

## mail the message ##

$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";

if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}

mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for submitting our form. We will get back to you as soon as possible.";
}

?>

sharkey182uk
04-20-2004, 01:05 PM
Hey guys ive received the emails now but there is still one problem the fact that i added more <input>s etc to the forum only the ones in the template emailed to me. Could it be that they all have the same name="message" as i have changed that now.

Hope yous can help

black3842
04-20-2004, 06:43 PM
I would recommend this formmail script....it's easy to setup, and it has worked well for me, no matter how many fields you have. It's a php clone of the famous matt's script archive formmail script. It's a lot longer than the once you have.....so thinking it's a lot more intelligent, it will allow form validation, etc......built in.

http://www.boaddrink.com/projects/phpformmail/

sharkey182uk
04-20-2004, 08:53 PM
Hey thanks mate i will give that a try.


Thanks for all help again :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum