problem with form mailling script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
webgenius
Forum Newbie
Posts: 12
Joined: Sat Aug 16, 2003 3:29 am
Location: Lagos, Nigeria
Contact:

problem with form mailling script

Post by webgenius »

I need help with this script. I'm using for a form on my site. It appears to be working but it isn't. It doesn't send the mail to the email address I specified.

-----------------------------

<meta http-equiv="refresh" content="10;URL=thank_you.php">
<?php
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$email=$_POST['email'];
$telephone=$_POST['telephone'];
$company=$_POST['company'];
$contact=$_POST['contact'];
$location=$_POST['location'];
$subject=$_POST['subject'];
$comments=$_POST['comments'];
$to="vistatech@lycos.co.uk";
$message="$firstname $lastname has just submitted this message with the subject - $subject - . The message says:\n$comments\n\n My E-mail address is: $email, Telephone is: $telephone, Company is: $company, Contact is: $contact and Location is: $location";
if(mail($to,"Message for Vista Technologies",$message,"From: $email\n")) {
echo "Your message has been sent to Vista Technologies. Thank you for contact us, we will get back to you as soon as possible. This page will redirect";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?><title>Processing Form...</title>

------------------------------

You can check it out at http://www.vista.hostrocket.com/contact_vista.php.

I dont know what else to do to it.

Thank you.

Ladi Adewumi
http://www.vistatech.5u.com
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

link doesn't work
User avatar
dev2761
Forum Newbie
Posts: 16
Joined: Thu Oct 16, 2003 7:55 am
Contact:

Post by dev2761 »

thats because theres a dot at the end
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

I removed it and it didn't work. It was like that subdomain wasn't a valid hostrocket account.

Seems to be working alright now...
Post Reply