感谢您花时间审查我的问题。我在 Centos 6.4 上设置了 postfix 我对电子邮件服务器或 PHP 不是很熟悉,但我想设置一个简单的视图来使用 postfix 发送电子邮件。有人告诉我应该使用 php。我的电流。(不工作)源代码是这个......
<!doctype html>
<html>
<head>
<style type="text/css">
#mainContainer
{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
#adressContainer
{
width:100%;
height:3%;
}
#buttonContainer
{
width:100%;
height:5%;
}
#bodyContainer
{
width:100%;
height:90%;
}
#address
{
resize:none;
width:100%;
height:100%;
}
#bodyText
{
resize:none;
width:100%;
height:100%;
}
</style>
<script>
<?php
function sendMail()
{
$to = "someone@somewhere"
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
}
?>
</script>
<!--<link rel="stylesheet" type="text/css" href="email.css" />-->
</head>
<body>
<div id="mainContainer">
<div id="addressContainer">
<input id="adress" type="text" name="Adress: "></input>
</div>
<div id="buttonContainer">
<button type="submit" onclick="sendMail()">send</button>
</div>
<div id="bodyContainer">
<textarea id="bodyText">I love you whitney :) </textArea>
</div>
</div>
</body>
</html>