http://www.philwill30.smokyhosts.com
The above is my site, on the main page you will find an e-mail link. I can't get it to work, I want it to send e-mail to my account made with cpanel, but no matter what url i try, it dont work. Could someone please tell me what i need to type in the action input of the form to get it to work? Ill even paste the code used...
<FORM METHOD="POST" ACTION="http://www.philwill30.smokyhosts.com/ph ... n/sendmail">
<p align="center"><font color="#999966" size="4">
Name</font><font face="Rockwell"><INPUT TYPE="text" Name="name" SIZE="35">
</font>
<P align="center"><font color="#999966" size="4">
E-mail</font><font face="Rockwell"><INPUT TYPE="text" Name="mail" SIZE="35">
</font>
<P align="center"><font color="#999966" size="4">
Message</font><font face="Rockwell"><TEXTAREA NAME="Message" ROWS=8 COLS=70></TEXTAREA>
<P align="center"><INPUT TYPE="Submit"><INPUT TYPE=Reset></FORM>
I hope someone can help me....[/b][/url]
Help making E-mail work right on my page
-
- Posts: 206
- Joined: Mon Jan 31, 2005 1:37 am
I think the problem is that action link to sendmail. If you installed that manually probably it will work with PHP, not HTML.
If you go to "CGI Center" link on your cPanel you will find "CGI EMail". That one would work fine with HTML.
Follow its guide (http://web.mit.edu/wwwdev/cgiemail/user.html) and you'll receive thousands of emails from your site
If you go to "CGI Center" link on your cPanel you will find "CGI EMail". That one would work fine with HTML.
Follow its guide (http://web.mit.edu/wwwdev/cgiemail/user.html) and you'll receive thousands of emails from your site
L O L
-
- Posts: 206
- Joined: Mon Jan 31, 2005 1:37 am
-
- Posts: 206
- Joined: Mon Jan 31, 2005 1:37 am
First of all you don't have to install anything else because CGI EMail is already installed in our servers.
Then here we go.
Create a .txt file with the e-mail address that will receive the form, subject and the keywords:
To: philwill30@philwill30.com
Subject: Things they say through my site
Name: [name]
E-mail: [mail]
Message: [message]
These names between brackets [] are the same input type names you are using in your form:
<INPUT TYPE="text" Name="name" SIZE="35">
In your form action you put
action="http://www.philwill30.smokyhosts.com/cg ... iemail/the directory your .txt is/your form txt name.txt"
That should work. Simple like that!
You can also add a success or thanking page that will appear just after submit:
For just a message put the following on your form. Remind you can change the value.
<INPUT TYPE="hidden" NAME="addendum" VALUE="Thank you!">
If you want to redirect to another page after submit put
<INPUT TYPE="hidden" NAME="success" VALUE="http://your page addess/something/you decide/">
Another thing I observed is that Rockwell font you are using. I don't know if you are aware that people will see this font on their browsers only if they have it installed on their computers. Otherwise they will see default fonts like Times New Roman and Arial.
Then here we go.
Create a .txt file with the e-mail address that will receive the form, subject and the keywords:
To: philwill30@philwill30.com
Subject: Things they say through my site
Name: [name]
E-mail: [mail]
Message: [message]
These names between brackets [] are the same input type names you are using in your form:
<INPUT TYPE="text" Name="name" SIZE="35">
In your form action you put
action="http://www.philwill30.smokyhosts.com/cg ... iemail/the directory your .txt is/your form txt name.txt"
That should work. Simple like that!
You can also add a success or thanking page that will appear just after submit:
For just a message put the following on your form. Remind you can change the value.
<INPUT TYPE="hidden" NAME="addendum" VALUE="Thank you!">
If you want to redirect to another page after submit put
<INPUT TYPE="hidden" NAME="success" VALUE="http://your page addess/something/you decide/">
Another thing I observed is that Rockwell font you are using. I don't know if you are aware that people will see this font on their browsers only if they have it installed on their computers. Otherwise they will see default fonts like Times New Roman and Arial.
L O L
-
- Posts: 206
- Joined: Mon Jan 31, 2005 1:37 am
here is my version it has option to send email to as many people as you want
<?php
$email1 = "email 1";
$email2 = "email 2";
$from = stripslashes($_POST['email']);
if($_POST['emailwhich'] == 1){
$sendTo = $email1;
}
else if($_POST['emailwhich'] == 2){
$sendTo = $email2;
}
if($from){
$subject = stripslashes($_POST['subject']);
$message = stripslashes($_POST['message']);
$headers = "From: $from\n";
$headers .= "Content-type: text;\r\n";
mail($sendTo,$subject,$message,$headers);
header("location:http://www.yourdomain.com/thankyou.htm");*\\Put the location oh the page they will be transfered to here
exit;
}
else{
?>
<html>
<head>
<title>Contact us</title>
</head>
<body>
<h1>Contact Form</h1>
<form name="contact" action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST">
Please use this form to contact us:</p>
Your e-mail will be sent to::
<select name="emailwhich">
<option value="1">name for email 1</option>
<option value="2">name for email 2</option>
</select></p>
Enter Your Email Address:
<input type="text" name="email" style="width:150px;"></p>
Enter Your Website:
<input type="text" name="subject" style="width:250px;"></p>
Enter Your Message:
<textarea name="message" cols="0" rows="0" style="width:300px;height;200px;"></textarea>
</p>
<input type="submit" value="Send Email">
<input type="reset" name="Reset" value="Reset">
<a>Copyright ELRocco of ELRocco.co.nr</a>
</form>
</body>
</html>
<?
}
?>
<?php
$email1 = "email 1";
$email2 = "email 2";
$from = stripslashes($_POST['email']);
if($_POST['emailwhich'] == 1){
$sendTo = $email1;
}
else if($_POST['emailwhich'] == 2){
$sendTo = $email2;
}
if($from){
$subject = stripslashes($_POST['subject']);
$message = stripslashes($_POST['message']);
$headers = "From: $from\n";
$headers .= "Content-type: text;\r\n";
mail($sendTo,$subject,$message,$headers);
header("location:http://www.yourdomain.com/thankyou.htm");*\\Put the location oh the page they will be transfered to here
exit;
}
else{
?>
<html>
<head>
<title>Contact us</title>
</head>
<body>
<h1>Contact Form</h1>
<form name="contact" action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST">
Please use this form to contact us:</p>
Your e-mail will be sent to::
<select name="emailwhich">
<option value="1">name for email 1</option>
<option value="2">name for email 2</option>
</select></p>
Enter Your Email Address:
<input type="text" name="email" style="width:150px;"></p>
Enter Your Website:
<input type="text" name="subject" style="width:250px;"></p>
Enter Your Message:
<textarea name="message" cols="0" rows="0" style="width:300px;height;200px;"></textarea>
</p>
<input type="submit" value="Send Email">
<input type="reset" name="Reset" value="Reset">
<a>Copyright ELRocco of ELRocco.co.nr</a>
</form>
</body>
</html>
<?
}
?>