我使用联系表格,从现在开始就可以使用。单击“发送”后,我确认消息并没有任何反应。网站管理员邮件"test@gmail.com"
就是一个例子。
这是代码:
<?php
ini_set('default_charset', 'UTF-8');
/* Subject and Email Variables */
$emailSubject = 'Wiadomosc z Formularza Kontaktowego ze strony WWW';
$webMaster = 'test@gmail.com';
$headers .= "Content-type: text/html; charset=UTF-8";
/* Gathering Data Variables*/
$name = $_POST['name'];
$company = $_POST['company'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$topic = $_POST['topic'];
$text = $_POST['text'];
if (empty($_POST['email']))
{
echo 'error';
exit;
}
if (empty($_POST['phone']))
{
echo 'error';
exit;
}
if (empty($_POST['name']))
{
echo 'error';
exit;
}
if (empty($_POST['text']))
{
echo 'error';
exit;
}
$body = <<<EOD
Imię i Nazwisko: $name <br />
Organizacja/Firma: $company <br />
Numer telefonu: $phone <br />
Email: $email <br />
Temat: $topic <br />
Wiadomość: $text <br />
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
/* Results rendered as HTML */
$theResults = <<<EOD
OK
EOD;
echo $theResults;
?>
是服务器吗?或者也许有什么东西想念我?