FreePgs.com Forum
December 07, 2021, 01:55:58 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Click Here for Toll-Free Service for your business starting at $2.00 per month and 4.5 cents per minute
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: PHP online quote form mail problem  (Read 6277 times)
Incubus
Verified Account
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 6

Blog entries (0)

View Profile
« on: February 26, 2007, 10:28:45 AM »

Hi, I'm having some php trouble...

I have an online quote form which has the following code

<form method="POST" action="contact.php">

<p>Email From: <br>
<input type="text" name="EmailFrom">
<p>Name:<br>
<input type="text" name="Name">
<p>Address:<br>
<textarea name="Address"></textarea>
<p>Tel:<br>
<input type="text" name="Tel">
<p>WeddingHire:<br>
<input type="checkbox" name="WeddingHire" value="Yes">
<p>CorporateHire:<br>
<input type="checkbox" name="CorporateHire" value="Yes">
<p>Questions/Comments:<br>
<textarea name="QuestionsAndComments"></textarea>
<p><input type="submit" name="submit" value="Submit">
</form>


<?php
// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "scottlarnach@hotmail.co.uk";
$Subject = "Email From Website";
$Name = Trim(stripslashes($_POST['Name']));
$Address = Trim(stripslashes($_POST['Address']));
$Tel = Trim(stripslashes($_POST['Tel']));
$WeddingHire = Trim(stripslashes($_POST['WeddingHire']));
$CorporateHire = Trim(stripslashes($_POST['CorporateHire']));
$QuestionsAndComments = Trim(stripslashes($_POST['QuestionsAndComments']));

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "WeddingHire: ";
$Body .= $WeddingHire;
$Body .= "\n";
$Body .= "CorporateHire: ";
$Body .= $CorporateHire;
$Body .= "\n";
$Body .= "QuestionsAndComments: ";
$Body .= $QuestionsAndComments;
$Body .= "\n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
}
?>


when I run this it just keeps returning the error page and not sending the message, is there something obviously wrong with this? Are any special handles required for the php mail function with freepgs?

Any help will be greatly appreciated
Logged
brainiac744
Verified Account
Sr. Member
*

Karma: +10/-0
Offline Offline

Posts: 403

Blog entries (0)

View Profile
« Reply #1 on: February 26, 2007, 12:06:40 PM »

If you have not done so already you need to log into your account and use the contact form to request that mail() is enabled on your account. At first glance I don't see any problem with your code though, so I assume that this will fix your problem.
Logged
FreePgs.com Forum
« Reply #1 on: February 26, 2007, 12:06:40 PM »

 Logged
Incubus
Verified Account
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 6

Blog entries (0)

View Profile
« Reply #2 on: February 26, 2007, 03:59:40 PM »

thanks very much, i'll go do that just now
Logged
acidbath
Verified Account
Jr. Member
*

Karma: +0/-0
Offline Offline

Posts: 33

Blog entries (0)

View Profile
« Reply #3 on: February 27, 2007, 05:06:07 PM »

hopefully you do not have a problem sending newsletters
http://forum.freepgs.com/index.php?topic=1618.0
Logged
FreePgs.com Forum
« Reply #3 on: February 27, 2007, 05:06:07 PM »

 Logged
brainiac744
Verified Account
Sr. Member
*

Karma: +10/-0
Offline Offline

Posts: 403

Blog entries (0)

View Profile
« Reply #4 on: February 27, 2007, 06:25:42 PM »

@acidbath Since this topic has NOTHING to do with newsletters I consider that spam. If you have a problem with freepgs move to another host, it's not like you're paying a lot for the hosting.
Logged
acidbath
Verified Account
Jr. Member
*

Karma: +0/-0
Offline Offline

Posts: 33

Blog entries (0)

View Profile
« Reply #5 on: February 27, 2007, 06:28:12 PM »

fact is that I am not receiving the services that I did pay for. no matter the price.
Logged
admin
Administrator
Hero Member
*****

Karma: +30/-2
Offline Offline

Posts: 1567

Blog entries (0)

View Profile
« Reply #6 on: February 28, 2007, 10:13:40 PM »

Nowhere did we guarantee you the ability to use the mail function.

Thank you,
FreePgs.com Admin
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!