Contact.php Email Form Not Emailing

Status
Not open for further replies.

bigjohnsta

New Member
Messages
3
Reaction score
0
Points
0
Alright so here's my site:

http://jchambo.pcriot.com/

For some reason the Email Contact Form at the bottom isn't working, even though it routs itself to the success page when you click "submit"

Anyone know how to fix this so after someone fills out the form the person's info goes to my email?

HELP PLEASE!


EDIT: Sorry here's the code i'm using:

INDEX.HTM FILE:

<form method="POST" action="contact.php">
<table width="677" height="172" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="244" height="10">
<p class="style12">Email From:<span class="style4 style19">*</span><br>
<input type="text" name="EmailFrom">

</td>
<td width="369"><p class="style12 style1">Company:<br>
<input type="text" name="Company"></td>
</tr>
<tr>
<td height="10"><p class="style12">Subject: <br>
<input type="text" name="Subject"></td>
<td height="10"><p class="style12 style1">Website:<br>
<input type="text" name="Website"></td>
</tr>
<tr>
<td height="99"><p class="style12 style1">Name:<br>
<input type="text" name="Name">
<table width="244" height="80" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
</td>
<td><p class="style12 style1">Message:<br>
<textarea name="Message" cols="50"></textarea>
<p><span class="style12 style1">
<input type="submit" name="submit" value="Send Message">
</span>
<span class="style12 style1 style2 style13">Fields marked <span class="style18">(*)</span> are required</span></td>
</tr>
</table></form>


CONTACT.PHP FILE:

<?php
// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link

// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "bigjohn-sta@comcast.net";
$Subject = Trim(stripslashes($_POST['Subject']));
$Name = Trim(stripslashes($_POST['Name']));
$Company = Trim(stripslashes($_POST['Company']));
$Website = Trim(stripslashes($_POST['Website']));
$Message = Trim(stripslashes($_POST['Message']));

// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Company: ";
$Body .= $Company;
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$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=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
 
Last edited:

OdieusG

New Member
Messages
50
Reaction score
0
Points
0
Alright so here's my site:

http://jchambo.pcriot.com/

For some reason the Email Contact Form at the bottom isn't working, even though it routs itself to the success page when you click "submit"

Anyone know how to fix this so after someone fills out the form the person's info goes to my email?

HELP PLEASE!


What's the code you're using?
This should help if you're using PHP
Code:
http://us3.php.net/manual/en/function.mail.php
 

OdieusG

New Member
Messages
50
Reaction score
0
Points
0
It seems briefly, it should work....have you tried to just output the mail to the OB (Output Buffer) to see if it's displaying correctly?
Instead of calling mail, make a few lines, just to output the info, and test it out

I don't know why the stripslashes are in there, since it's a normal string, but for the most part, I'm not seeing any problems
 

bigjohnsta

New Member
Messages
3
Reaction score
0
Points
0
Well, this is the FIRST Contact Email Form I have ever tried, and I used a generator as you can see in the Contact.php file.

So I really have no idea what you're talking about lol. I do know a lot about HTML but .php is more complex to me. So, i'm not exactly sure what to edit....

EDIT: I do have both of the files open in DreamWeaver if this helps.

EDIT 2:

I figured out that Comcast does not allow incoming PHP email messages. So if you're using a comcast email as an incoming email address to receive these PHP messages, it does not work. I signed up for a Gmail account and it works just fine.

Thanks anyway!
 
Last edited:

OdieusG

New Member
Messages
50
Reaction score
0
Points
0
Well, something new to remember! I know X10 provides e-mail, so that's another option.....don't have to go far for what you need here

It's probably best to bookmark W3Schools, located all over this forum, and keep that on hand, in case you do stuck again
Well, this is the FIRST Contact Email Form I have ever tried, and I used a generator as you can see in the Contact.php file.

So I really have no idea what you're talking about lol. I do know a lot about HTML but .php is more complex to me. So, i'm not exactly sure what to edit....

EDIT: I do have both of the files open in DreamWeaver if this helps.

EDIT 2:

I figured out that Comcast does not allow incoming PHP email messages. So if you're using a comcast email as an incoming email address to receive these PHP messages, it does not work. I signed up for a Gmail account and it works just fine.

Thanks anyway!
 
Status
Not open for further replies.
Top