Jump to content

PHP Form Mail Help


xUSR

Recommended Posts

Hey everyone. I am extremely new to PHP coding and I wanted to take a shot at making a basic mail form submission. I have done a lot of research and cannot get my test files to work. No e-mails get sent to me. I appreciate any help you can offer. Here are the following pages:

 

http://www.insightguild.com/contactformpage.html

 

http://www.insightguild.com/sendmail.php

(coding is viewable when you navigate to this file)

 

I am using Bluehost.com as my hosting server. Thanks

 

Link to comment
Share on other sites

Ok, so PHP is installed and working correctly on your server, but your sendmail.php file is not being parsed by php and is instead being looked at as some sort of text file. Do you have anything in the error logs that come up when accessing sendmail.php from the browser?

Link to comment
Share on other sites

this is all I see in the error logs:

 

[Tue Apr 03 13:29:56 2012] [warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.

[Tue Apr 03 13:29:57 2012] [warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.

[Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/

[Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/

[Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/

[Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/

[Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/

[Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/

[Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/

[ pid=27441 thr=140266441140192 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2012-04-03 13:29:59.18 ]: Flushing all sinks (periodic action)

[Tue Apr 03 13:29:59 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/

[Tue Apr 03 13:29:59 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/

Link to comment
Share on other sites

I am actually creating it all through notepad, including the php files

 

edit:

just opened up sendmail.php to double check and it looks like it has been changed to

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 

<head>

<meta content="en-us" http-equiv="Content-Language" />

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

<title>Untitled 1</title>

</head>

 

<body>

 

<p><?php<br />

<br />

$emailSubject = &#39;Insight Application&#39;;<br />

$webMaster = &#39;m1f7@aol.com&#39;;<br />

<br />

$emailField = $_POST[&#39;email&#39;];<br />

$nameField = $_POST[&#39;name&#39;];<br />

$phoneField = $_POST[&#39;phone&#39;];<br />

$budgetField = $_POST[&#39;budget&#39;];<br />

$travelersField = $_POST[&#39;travelers&#39;];<br />

$newsletterField = $_POST[&#39;newsletter&#39;];<br />

<br />

$body = <<<EOD<br />

<br><hr><br><br />

Email: $emailField <br><br />

Name: $nameField <br><br />

Phone Number: $phoneField <br><br />

Budget: $budgetField <br><br />

Newsletter: $newsletterField <br><br />

EOD;<br />

<br />

$headers = "From: @email\r\n";<br />

$headers .="Content=type: text/html\r\n";<br />

mail($webMaster, $emailSubject, $body, $headers);<br />

<br />

?></p>

 

</body>

 

</html>

Link to comment
Share on other sites

thanks for the help guys, I figured it out. Apparently bluehost.com doesn't allow you to send php form mail to an e-mail address that does not reside on it's server. Once I tried it with the webmaster e-mail address it worked fine.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.