PDA

View Full Version : HTML Email Sending Form


parttimetechie
01-14-2011, 12:53 AM
Is there any way to send a form a user fills out to an email for my business which would not be all gibberish and would automatically send without requiring them to open their email client in HTML?

Robert
01-14-2011, 01:58 AM
One question first - what scripting languages does your web server support? (i.e. PHP, ASP, etc)

ATS
01-14-2011, 01:59 AM
HTML is just a display language. It does not contain the functionality to process data like this. I would look into PHP Mailer (Google it) to use PHP to send the form fields as an email.

parttimetechie
01-14-2011, 02:26 AM
I know for sure it can use PHP. I was hoping not to have to download anything or do extensive coding, but it looks like I will have to do so.

ATS
01-14-2011, 02:29 AM
If you have a Gmail account (or set one up real quick), you can use PHP Mailer to send the form using the Gmail servers. It saves you the trouble of running your own SMTP server.

ProTech Support
01-14-2011, 03:03 AM
Not sure if I am understanding your question correctly, but why don't you just create a one page form on your website and e-mail them the link?

parttimetechie
01-14-2011, 03:35 AM
I want people to be able to call up my website, go to the form, fill in their troubles, and have that information be emailed to me.

Vicenarian
01-14-2011, 03:36 AM
Another reason why I love wordpress. So easy to do.

Robert
01-14-2011, 03:41 AM
I know for sure it can use PHP. I was hoping not to have to download anything or do extensive coding, but it looks like I will have to do so.

If you don't mind spending a couple of bucks, there are plenty of cheap (and easy to integrate) contact forms on CodeCanyon (http://codecanyon.net/category/php-scripts/forms).

parttimetechie
01-14-2011, 03:54 AM
I'd like to do it for free if I could. There is no way to have the program just send the form without opening up my email client?

ATS
01-14-2011, 04:10 AM
Yes, PHP will send the form without opening the email client. PHP is a free download.

tminer
01-14-2011, 05:31 AM
Having an email link on the page will cause the users email client to open.

A form on your website will have code behind it that submits the data directly to your specifed email address.

You need to know what your web server type is first to determine what will be compatible. Your web host might have some kind of plugin, program or example on how to do this.

Otherwise, Im sure there are some free options out there, you just have to google for them

parttimetechie
01-14-2011, 06:38 AM
Ya, I know about PHP, but never got my head around the coding..just not that kind of a programmer.

I think that's why I never did a mailto: command b/c I wanted the people to copy and paste the email into whatever client they were using.

tminer
01-14-2011, 05:34 PM
the mailto: command is definetly not the right way to go.

for one it opens you use to robot spam that gathers email addresses on websites.

second, most people are lazy and you need to make it as easy as possible for them or you may lose potential customers.

there are many easy to integrate php scripts out there, its just a simple contact form.

parttimetechie
01-14-2011, 06:39 PM
And I would just drop the PHP script into the HTML of my page?

tminer
01-14-2011, 06:55 PM
yeah pretty much, you may have to configure a couple of strings like your email address, server, etc, i use asp instead of php so i dont know what script to recommend but i know there out there.

GeekPCSupport
01-14-2011, 06:59 PM
And I would just drop the PHP script into the HTML of my page?

Yes and no. It depends if you want to use Capatcha or not. If you do not want to use Capatcha then you would need to configure the script first (very easy to do) and then link it to your site after you upload the files.

For a very easy form to use with step by step directions, just visit this site:

http://www.easyphpcontactform.com/

Like most scripts that are free, the author requires you to keep the link back to his site intact. If you would like to remove it, you need to pay a $9 the last time I checked.

Guillermo

rusty.nells
01-14-2011, 07:03 PM
What exactly do you need? I may be able to put something together for you. Don't expect a quick turnaround though, I am currently on a "road trip".

NeutronTech
01-14-2011, 09:35 PM
I know nothing about PHP and I was able to get my contact form up and running really easy. The script was well documented and I just had to read it and type in my email address, url, etc where it said to. Then just drop the php file in my web folder, create the confirmation / thank you html files, then call the script from my form. It really was just following directions. Took less than an hour.

parttimetechie
01-14-2011, 10:50 PM
What exactly do you need? I may be able to put something together for you. Don't expect a quick turnaround though, I am currently on a "road trip".

I would like a way to send data from a form in HTML foramt to an email I desire. Could you do something like that? I will take a look at the scripts and see what I can come up with on my own as well.

parttimetechie
01-15-2011, 02:37 AM
I would like to do what this person has done. I have all of the html text set, I just want to be able to hit submit like you can here and have it be emailed to me.

http://www.computerguysofoc.com/forms/call_me/Call_Me.html

gazza
01-15-2011, 05:47 AM
I have used this site for email form building. It works well.

http://www.emailmeform.com/

parttimetechie
01-15-2011, 05:53 AM
I got this supposed php script from online, and made changes, but when I go to press submit I get an invalid Email address error. I know nothing about PHP, what am I doing wrong?

<html>
<head><title>PHP Mail Sender</title></head>
<body>
<?php

/* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */
$email = $HTTP_POST_VARS['email'];
$subject = $HTTP_POST_VARS['subject'];
$message = $HTTP_POST_VARS['message'];

/* PHP form validation: the script checks that the Email field contains a valid email address and the Subject field isn't empty. preg_match performs a regular expression match. It's a very powerful PHP function to validate form fields and other strings - see PHP manual for details. */
if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email="tech@wadsley.us")) {
echo "<h4>Invalid email address</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
} elseif ($subject == "") {
echo "<h4>No subject</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
}

/* Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. */
elseif (mail($email,$subject,$message)) {
echo "<h4>Thank you for sending email</h4>";
} else {
echo "<h4>Can't send email to $email</h4>";
}
?>
</body>
</html>

ubuzz
01-15-2011, 01:38 PM
If you are on a unix hosting platform then you can use a formmail script. Here is the one that I use: http://www.scriptarchive.com/formmail.html

It's pretty easy to set up and will do what you want to do. It will not open an email client.

You may want to check with your web host as well. They may have a formmail option built in to your web host control panel.

parttimetechie
01-15-2011, 05:53 PM
I am using a windows hosted platform, and my hosting site does not have the mailform.

TopLevelComp
01-15-2011, 06:53 PM
I use a HTML form setup, then pass the form data to a PHP file.

This what the code for my php file looks like:
<?
// declare values
$department = $_POST['department'];
$technicalIssue = $_POST['technicalissue'];
$customerService = $_POST['customerservice'];
$firstName = $_POST['firstname'];
$lastName = $_POST['lastname'];
$phoneNumber = $_POST['phonenumber'];
$contactEmail = $_POST['email'];
$contactMethod = $_POST['contact'];
$accountNumber = $_POST['accountnumber'];
$contactSubject = $_POST['Subject'];
$contactMessage = $_POST['question'];
$mydate = date ( 'l, F d Y g:i A',time()+240 );

// where to send e-mail to
$to = 'jason.johnson@toplevelcomputers.com';

// e-mail subject
$subject = "Message submitted from Contact Us form";

// e-mail message
$message = "You have received a contact message:\r\n"

."----------------------------------------------------------------\r\n"
."Contact First Name: $firstName\r\n"
."Contact Last Name: $lastName\r\n"
."Contact Phone Number: $phoneNumber\r\n"
."Contact Account Number: $accountNumber\r\n"
."Contact's Prefered Method of Contact: $contactMethod\r\n"
."Submitted: $mydate\r\n"
."Department: $department\r\n"
."Issue: $technicalIssue\r\n"
."Customer Service: $customerService\r\n"
."From IP: {$_SERVER['REMOTE_ADDR']}\r\n\r\n"
."Message: $contactMessage\r\n";

$headers = "From: $firstName $lastName <$contactEmail>\n"
."Reply-To: $contactEmail\n"
."X-Mailer: PHP/".phpversion();

mail( $to, $subject, $message, $headers );
echo "<h3>Message Sent!</h3><p>Dear $firstName,<br /><br />We will get back to you as soon as possible using $contactEmail or $phoneNumber.</p>";
?>

This is the contact form:
http://www.toplevelcomputers.com/contactus.html

Code for Contact Us form:
<form method="post" action="includes/sendemail.php">
<table width="700px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="250" align="right">Department to send the E-mail to :</td>
<td width="450" height="30px" align="left">
<label>
<input type="radio" name="department" value="Customer Service" id="customerservice" />
Customer Service</label>
<label>
<input type="radio" name="department" value="Technical Gurus" id="technicalgurus" />
Technical Gurus</label>
<label>
<input type="radio" name="department" value="Sales" id="sales" />
Sales</label>
</td>
</tr>
</table>
<table width="700px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="250" align="right">First Name :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="firstname" type="text" size="30" maxlength="50" class="contactFields" /></td>
</tr>
<tr>
<td width="250" align="right">Last Name :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="lastname" type="text" size="30" maxlength="50" class="contactFields" /></td>
</tr>
<tr>
<td width="250" align="right">Phone Number :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="phonenumber" type="text" size="30" maxlength="14" class="contactFields" onkeydown="javascript:backspacerDOWN(this,event);" onkeyup="javascript:backspacerUP(this,event);" />&nbsp;</td>
</tr>
<tr>
<td width="250" align="right">E-Mail :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="email" type="text" size="30" maxlength="50" class="contactFields" />&nbsp;</td>
</tr>
<tr>
<td width="250" align="right">Prefered Method Of Contact :</td>
<td width="450" height="30px" align="left">
<label>
<input type="radio" name="contact" value="Phone" id="phone" class="contactFields" />
Phone
</label>
<label>
<input type="radio" name="contact" value="Email" id="email" class="contactFields" />
Email
</label>
</td>
</tr>
<tr>
<td width="250" align="right">Account # :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="accountnumber" type="text" size="30" maxlength="8" class="contactFields" />
</td>
</tr>
<tr>
<td width="250" align="right">Question :</td>
<td width="450" height="30px" align="left">&nbsp;<textarea name="question" cols="60" rows="8" class="contactFields"></textarea>
</td>
</tr>
<tr>
<td width="250" align="right"></td>
<td width="450" height="30px" align="left"><input name="" type="submit" value="Submit" class="contactFields" /><input name="" type="reset" class="contactFields" />
</td>
</tr>
</table>
</form>

parttimetechie
01-15-2011, 07:04 PM
I use a HTML form setup, then pass the form data to a PHP file.

This what the code for my php file looks like:
<?
// declare values
$department = $_POST['department'];
$technicalIssue = $_POST['technicalissue'];
$customerService = $_POST['customerservice'];
$firstName = $_POST['firstname'];
$lastName = $_POST['lastname'];
$phoneNumber = $_POST['phonenumber'];
$contactEmail = $_POST['email'];
$contactMethod = $_POST['contact'];
$accountNumber = $_POST['accountnumber'];
$contactSubject = $_POST['Subject'];
$contactMessage = $_POST['question'];
$mydate = date ( 'l, F d Y g:i A',time()+240 );

// where to send e-mail to
$to = 'jason.johnson@toplevelcomputers.com';

// e-mail subject
$subject = "Message submitted from Contact Us form";

// e-mail message
$message = "You have received a contact message:\r\n"

."----------------------------------------------------------------\r\n"
."Contact First Name: $firstName\r\n"
."Contact Last Name: $lastName\r\n"
."Contact Phone Number: $phoneNumber\r\n"
."Contact Account Number: $accountNumber\r\n"
."Contact's Prefered Method of Contact: $contactMethod\r\n"
."Submitted: $mydate\r\n"
."Department: $department\r\n"
."Issue: $technicalIssue\r\n"
."Customer Service: $customerService\r\n"
."From IP: {$_SERVER['REMOTE_ADDR']}\r\n\r\n"
."Message: $contactMessage\r\n";

$headers = "From: $firstName $lastName <$contactEmail>\n"
."Reply-To: $contactEmail\n"
."X-Mailer: PHP/".phpversion();

mail( $to, $subject, $message, $headers );
echo "<h3>Message Sent!</h3><p>Dear $firstName,<br /><br />We will get back to you as soon as possible using $contactEmail or $phoneNumber.</p>";
?>

This is the contact form:
http://www.toplevelcomputers.com/contactus.html

Code for Contact Us form:
<form method="post" action="includes/sendemail.php">
<table width="700px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="250" align="right">Department to send the E-mail to :</td>
<td width="450" height="30px" align="left">
<label>
<input type="radio" name="department" value="Customer Service" id="customerservice" />
Customer Service</label>
<label>
<input type="radio" name="department" value="Technical Gurus" id="technicalgurus" />
Technical Gurus</label>
<label>
<input type="radio" name="department" value="Sales" id="sales" />
Sales</label>
</td>
</tr>
</table>
<table width="700px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="250" align="right">First Name :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="firstname" type="text" size="30" maxlength="50" class="contactFields" /></td>
</tr>
<tr>
<td width="250" align="right">Last Name :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="lastname" type="text" size="30" maxlength="50" class="contactFields" /></td>
</tr>
<tr>
<td width="250" align="right">Phone Number :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="phonenumber" type="text" size="30" maxlength="14" class="contactFields" onkeydown="javascript:backspacerDOWN(this,event);" onkeyup="javascript:backspacerUP(this,event);" />&nbsp;</td>
</tr>
<tr>
<td width="250" align="right">E-Mail :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="email" type="text" size="30" maxlength="50" class="contactFields" />&nbsp;</td>
</tr>
<tr>
<td width="250" align="right">Prefered Method Of Contact :</td>
<td width="450" height="30px" align="left">
<label>
<input type="radio" name="contact" value="Phone" id="phone" class="contactFields" />
Phone
</label>
<label>
<input type="radio" name="contact" value="Email" id="email" class="contactFields" />
Email
</label>
</td>
</tr>
<tr>
<td width="250" align="right">Account # :</td>
<td width="450" height="30px" align="left">&nbsp;<input name="accountnumber" type="text" size="30" maxlength="8" class="contactFields" />
</td>
</tr>
<tr>
<td width="250" align="right">Question :</td>
<td width="450" height="30px" align="left">&nbsp;<textarea name="question" cols="60" rows="8" class="contactFields"></textarea>
</td>
</tr>
<tr>
<td width="250" align="right"></td>
<td width="450" height="30px" align="left"><input name="" type="submit" value="Submit" class="contactFields" /><input name="" type="reset" class="contactFields" />
</td>
</tr>
</table>
</form>

I appreciate the coding, but am having trouble adapting that to my HTML I have set up. How do I define the variables in my HTML for my PHP?

TopLevelComp
01-15-2011, 07:11 PM
I appreciate the coding, but am having trouble adapting that to my HTML I have set up. How do I define the variables in my HTML for my PHP?

HTML is client-side only. PHP is server-side, which is why when you view a PHP file you don't see the PHP code, you see the HTML code that PHP passed along.

You need to create a file called "sendmail.php" paste the PHP code in that.

Create a HTML file, and post the HTML file in that. Change the following:
action="includes/sendemail.php"
to where the file is located. I keep processing files in my includes folder, so you can do the same, or put it in your root folder, upto you.

Edit: Read that wrong.

The variables I use for PHP are for the PHP only.

$department = $_POST['department'];
This is defining a variable.
$department
is the variable.

$_POST['department']
Is saying "Use the information that was posted in the 'department' field from the form."

Create an HTML form, and define the name. Once you have that, create your variables. If your passing information from a form to a PHP file, use $_POST, if your using a PHP file and passing it to itself, change it $_GET

<input name="first_name" type="text" size="30" maxlength="50" class="contactFields" />
You'll want to create a PHP variable off of the name of the input field. Something like:
$firstname = $_POST['first_name'];
I don't use capitalization in PHP and HTML unless I have to as PHP is case sensitive, so if you accidentally wrote:
."Contact First Name: $firstName\r\n"
It wouldn't work as the variable defined is: $firstname not $firstName

parttimetechie
01-15-2011, 07:26 PM
I'm with you to that point. How do I define the ids in the HMTL?

This is the HTML I have for my form, I thought I had the ID's defined, but I guess not.

I can't tell you how much I appreciate your help. I understood bits and pieces of this, but now its all coming together :)

<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="Business.css" />
<title>Wadsley Tech Services Appointments</title>
<meta name="title" content="Wadsley Tech Services" />
<meta name="keywords" content="computer help, computer geek, PC technician, James Wadsley, computer repair, Wadsley Tech Services" />
<meta name="description" content="PC Consulting by James Wadsley" />
<meta name="author" content="James M Wadsley" />
</head>
<body>
<div id="container">
<center>
<img src="Newlogo-4.jpg" width="50%" alt="Logo"/>
</center>

<ul id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="Services.html">Services</a></li>
<li><a href="Contact.html">Contact</a></li>
<li><a href="Appointment.html">Appointments</a></li>
</ul>
<center>
<h1>Make An Appointment</h1>
<h2>Please fill in all areas of the form for a faster response</h2>
<form method="post" action="mail1.php">
<h3>

First Name: <Input type="text" name="firstname" />&nbsp;&nbsp;&nbsp;&nbsp;Last Name: <Input type="text" name="lastname" />&nbsp;&nbsp;&nbsp;&nbsp;
Contact # / Email: <Input type="text" name="number" />&nbsp;&nbsp;&nbsp;&nbsp;Best Time to Contact: <Input type="text" name="time" /><br><br>

Type of Problem:&nbsp;&nbsp;<Input type="checkbox" name="problem" value="Computer" />Computer&nbsp;<Input type="checkbox" name="problem" value="Perephial" />Mouse, Keyboard, External Hard Drive, Etc&nbsp;<Input type="checkbox" name="problem" value="Internet" />Internet Connection&nbsp;<Input type="checkbox" name="problem" value="Printer" />Printing Issues&nbsp;<Input type="checkbox" name="problem" value="Other" />Other<br><br>

Priority:&nbsp;&nbsp;<Input type="radio" name="priority" value="High" />High&nbsp;<Input type="radio" name="priority" value="Medium" />Medium&nbsp;<Input type="radio" name="priority" value="Low" />Low<br><br>

<p>
Description of Problem:
</p>
<textarea rows="10" cols="30"></textarea>
<br>
<br>
<input type="submit" value="submit">
<input type="reset" value="reset"
</h3>
</form>

parttimetechie
01-15-2011, 07:56 PM
Although I would still like to know how to do this, it appears Godaddy thinks this message is Spam. Here is the reply I get

Warning: mail() [function.mail]: SMTP server response: 554 The message was rejected because it contains prohibited virus or spam content in D:\Hosting\7203825\html\business\sendmail.php on line 37

Message Sent!
Dear Jane,

We will get back to you as soon as possible using or none.


Am I out of luck on this?

TopLevelComp
01-15-2011, 09:53 PM
Although I would still like to know how to do this, it appears Godaddy thinks this message is Spam. Here is the reply I get

Warning: mail() [function.mail]: SMTP server response: 554 The message was rejected because it contains prohibited virus or spam content in D:\Hosting\7203825\html\business\sendmail.php on line 37

Message Sent!
Dear Jane,

We will get back to you as soon as possible using or none.


Am I out of luck on this?

Talk to your hosting provider and see what's going on.

What does your PHP file look like? For me, line 37 is a blank line.

rusty.nells
01-15-2011, 10:40 PM
It's probably the domain listed in the headers. Try this:


$headers = "From: $firstName $lastName <tech@wadsley.us>\n"
."Reply-To: <$contactEmail>\n"
."X-Mailer: PHP/".phpversion();
I'm assuming wadsley.us is your domain.

TopLevelComp
01-15-2011, 10:57 PM
It's probably the domain listed in the headers. Try this:


$headers = "From: $firstName $lastName <tech@wadsley.us>\n"
."Reply-To: <$contactEmail>\n"
."X-Mailer: PHP/".phpversion();
I'm assuming wadsley.us is your domain.

Why would he put his own email address? It was coded with $contactEmail so that the email would be sent from the user, and replied to if need be.

Robert
01-15-2011, 11:24 PM
I use a HTML form setup, then pass the form data to a PHP file.

This what the code for my php file looks like:
<?
// declare values
$department = $_POST['department'];
$technicalIssue = $_POST['technicalissue'];
$customerService = $_POST['customerservice'];
$firstName = $_POST['firstname'];
$lastName = $_POST['lastname'];
$phoneNumber = $_POST['phonenumber'];
$contactEmail = $_POST['email'];
$contactMethod = $_POST['contact'];
$accountNumber = $_POST['accountnumber'];
$contactSubject = $_POST['Subject'];
$contactMessage = $_POST['question'];
$mydate = date ( 'l, F d Y g:i A',time()+240 );

// where to send e-mail to
$to = 'jason.johnson@toplevelcomputers.com';

// e-mail subject
$subject = "Message submitted from Contact Us form";

// e-mail message
$message = "You have received a contact message:\r\n"

."----------------------------------------------------------------\r\n"
."Contact First Name: $firstName\r\n"
."Contact Last Name: $lastName\r\n"
."Contact Phone Number: $phoneNumber\r\n"
."Contact Account Number: $accountNumber\r\n"
."Contact's Prefered Method of Contact: $contactMethod\r\n"
."Submitted: $mydate\r\n"
."Department: $department\r\n"
."Issue: $technicalIssue\r\n"
."Customer Service: $customerService\r\n"
."From IP: {$_SERVER['REMOTE_ADDR']}\r\n\r\n"
."Message: $contactMessage\r\n";

$headers = "From: $firstName $lastName <$contactEmail>\n"
."Reply-To: $contactEmail\n"
."X-Mailer: PHP/".phpversion();

mail( $to, $subject, $message, $headers );
echo "<h3>Message Sent!</h3><p>Dear $firstName,<br /><br />We will get back to you as soon as possible using $contactEmail or $phoneNumber.</p>";
?>


I hate to throw a spanner in the works, but you're REALLY going to want to sanitise that user input. Using raw user input is just asking for trouble, and definitely the quickest way to get your website hacked.

Take a look at http://net.tutsplus.com/tutorials/php/sanitize-and-validate-data-with-php-filters/ if you're running PHP 5.2+

Plus, I'd wrap the message sent notice in an if statement to check that it actually was sent... Something like:

if(mail( $to, $subject, $message, $headers ))
{
echo "<h3>Message Sent!</h3><p>Dear $firstName,<br /><br />We will get back to you as soon as possible using $contactEmail or $phoneNumber.</p>";
}
else
{
echo "<h3>Error!</h3><p>Your message was not sent. Please try again.</p>";
}

TopLevelComp
01-15-2011, 11:47 PM
I hate to throw a spanner in the works, but you're REALLY going to want to sanitise that user input. Using raw user input is just asking for trouble, and definitely the quickest way to get your website hacked.

Take a look at http://net.tutsplus.com/tutorials/php/sanitize-and-validate-data-with-php-filters/ if you're running PHP 5.2+

Plus, I'd wrap the message sent notice in an if statement to check that it actually was sent... Something like:

if(mail( $to, $subject, $message, $headers ))
{
echo "<h3>Message Sent!</h3><p>Dear $firstName,<br /><br />We will get back to you as soon as possible using $contactEmail or $phoneNumber.</p>";
}
else
{
echo "<h3>Error!</h3><p>Your message was not sent. Please try again.</p>";
}

It's been in the works of being reworked, I never really put effort into sanitizing it since it's not an extremely popular website. There's nothing of value to be lost if something does happen as all of my client data is stored off site, so I'm not worried.

rusty.nells
01-16-2011, 12:15 AM
Why would he put his own email address? It was coded with $contactEmail so that the email would be sent from the user, and replied to if need be.

The spam filter probably blocks relaying and if so, the email address must have have a domain matching the server.

TopLevelComp
01-16-2011, 12:21 AM
The spam filter probably blocks relaying and if so, the email address must have have a domain matching the server.

It's probably the multiple lines for headers, I'm sure if he changed it to:
$headers = "From: $firstName $lastName <$contactEmail>\n";
it would work.

parttimetechie
01-16-2011, 12:28 AM
I changed my hosting over to Linux, and it appears to have worked but the email never comes thru to my account.

Def something wrong with my coding, but no idea what since I am brand new to this PHP thing

rusty.nells
01-16-2011, 12:33 AM
I changed my hosting over to Linux, and it appears to have worked but the email never comes thru to my account.

Def something wrong with my coding, but no idea what since I am brand new to this PHP thing

Have you checked your spam folder?

EDIT: I'm assuming you have a spam folder.

parttimetechie
01-16-2011, 06:30 AM
I have, and nothing came through

TopLevelComp
01-16-2011, 08:31 PM
Can you post the PHP code?

GeekPCSupport
01-16-2011, 09:00 PM
Parttimetechie:
If you look at the root of your hosting, you will see a form called gdform.php. That is the contact script that Godaddy uses. All you need to do is create a contact us page (can use the one you already have) and in the form tag include this:
form name="contact" method="post" action="../gdform.php" This will send you the email. If you need to redirect after submission, just include this:
input type="hidden" name="redirect" value="thankyou.htm"

Just replace thankyou.htm with whatever page you want the visitor to go to.

If you need more help see http://community.godaddy.com/help/article/510

Hope this helps,
Guillermo

parttimetechie
01-16-2011, 11:21 PM
Do I need to modify the Godaddy php file at all? I would think I would need to put in at least the email address of where to send it.

I assume I can make this GD page like the previous PHP page I had? I still need to declare variables correct?

rusty.nells
01-18-2011, 05:09 AM
How's this going, have you figured it out yet? TopLevelComp's code seems more than adequate, have you got it working?

If not, replace the following in the .php file (for testing)


mail( $to, $subject, $message, $headers );
with this


echo $to . "<br />" . $subject . "<br />" . $message . "<br />" . $headers;
to verify that everything is correct.

GeekPCSupport
01-18-2011, 06:56 AM
parttimetechie:
I just sent you a PM.

Guillermo