PHP-Formmailer - kleines Problemchen

seberix

Mitglied
Morgähn!

Also ich hab mir von hotscripts einen formmailer runtergeladen der mit php läuft.

Muss ich da auf meinem Server jetzt auch irgendwas einstellen damit das funktioniert?

Hier mal das Script:


<?php
if(isset($_POST['contact']))
{
$name = strip_tags($_POST['name'], '');
$email = strip_tags($_POST['email'], '');
$subject = strip_tags($_POST['subject'], '');
$message = strip_tags($_POST['message'], '');

// You, the recepient
$to = "Mein Name <info@meinedomain.com>";//yourname and email address

// Addtional headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $name <$email>\r\n";

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

echo "Danke für ihre E-Mail!";//write your thanks message

header("Refresh:5; URL = http://www.meinedomain.com/contact/danke.htm");///"your thankyou url

exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Contact</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
function checkForm()
{
var gname, gemail, gsubject, gmessage;
with(window.document.contactform)
{
gname = name;
gemail = email;
gsubject = subject;
gmessage = message;
}
if(gname.value == '')
{
alert('Please enter your name!');
gname.focus;
return false;
}
if(gemail.value == '')
{
alert('Please enter your email!');
gemail.focus;
return false;
}
if(gsubject.value == '')
{
alert('Please enter subject!');
gsubject.focus;
return false;
}
else if(gmessage.value == '')
{
alert('Enter your message!');
gmessage.focus;
return false;
}
else
{
return true;
}
}
</script>
</HEAD>
<BODY BGCOLOR="#36B1E9" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
<table align="center" border="0" width="756" cellpadding="5" cellspacing="2">
<tr bgcolor="#FFFFFF">
<td style="border:1px solid #1C82B0;" width="550" valign="top">
<form name="contactform" action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post" onSubmit="return checkForm();">
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td width="80">Name:</td>
<td valign="middle"><input type="text" name="name" size="25" ></td>
</tr>
<tr>
<td valign="middle">Email:</td>
<td><input type="text" name="email" size="25" ></td>
</tr>
<tr>
<td valign="middle">Betreff:</td>
<td><input type="text" name="subject" size="25" ></td>
</tr>
<tr>
<td valign="top">Nachricht:</td>
<td><textarea name="message" cols="55" rows="14"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="contact" value="Absenden"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</BODY>
</HTML>
 
Ok - ich weiss jetzt nicht genau was du meinst - aber gehen wir mal davon aus das ein Mailserver installiert ist :)

Wie gehe ich weiter vor?
 
Naja du musst einige Angaben schon anpassen an deine Bedürfnisse z.B.

PHP:
 // You, the recepient
$to = "Mein Name <info@meinedomain.com>";//yourname and email address

und

PHP:
 echo "Danke für ihre E-Mail!";//write your thanks message

Viel mir so als erstes auf ka ob man da noch weitere individuelle Einstellungen tätigen kann.
 
Zurück