Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-20-2004, 10:31 AM   PM User | #1
sharkey182uk
New Coder

 
Join Date: Dec 2003
Location: UK
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
sharkey182uk is an unknown quantity at this point
PHP form mailer not working?

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.
sharkey182uk is offline   Reply With Quote
Old 04-20-2004, 11:09 AM   PM User | #2
sidney
Regular Coder

 
Join Date: Mar 2004
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
sidney is an unknown quantity at this point
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
sidney is offline   Reply With Quote
Old 04-20-2004, 11:16 AM   PM User | #3
sharkey182uk
New Coder

 
Join Date: Dec 2003
Location: UK
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
sharkey182uk is an unknown quantity at this point
This is my form mailer code here. Yeah i agree it coudl be my host.

PHP Code:
<?PHP 

####################################################### 
# This script is Copyright 2003, Infinity Web Design  # 
# Distributed by [url]http://www.webdevfaqs.com[/url]            #
# Written by Ryan Brill - [email]ryan@infinitypages.com[/email]      # 
# 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 is offline   Reply With Quote
Old 04-20-2004, 01:05 PM   PM User | #4
sharkey182uk
New Coder

 
Join Date: Dec 2003
Location: UK
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
sharkey182uk is an unknown quantity at this point
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
sharkey182uk is offline   Reply With Quote
Old 04-20-2004, 06:43 PM   PM User | #5
black3842
New Coder

 
Join Date: Apr 2004
Location: Texas
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
black3842 is an unknown quantity at this point
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/
__________________
Jason B
black3842 is offline   Reply With Quote
Old 04-20-2004, 08:53 PM   PM User | #6
sharkey182uk
New Coder

 
Join Date: Dec 2003
Location: UK
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
sharkey182uk is an unknown quantity at this point
Hey thanks mate i will give that a try.


Thanks for all help again
sharkey182uk is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:14 AM.


Advertisement
Log in to turn off these ads.