给你个不太成熟的程序吧,临时写的,我在新浪邮箱上测试通过:
文件一:mail.html
文件二:mail.php
记得把她们放在同一目录下!!!!!
假设你有新浪邮箱[email protected]###########------------文件一:mail.html-------########
<html><head><title>发信给hk_c</title></head>
<body>
<h2 align="center">hk_c发信界面</h2>
<hr color="blue">
<center>
<form action="mail.php">
发件人:<input type="text" name="from" size=25 [email protected]><br>
主题:<input type="text" name="subject" size=20><br>
内容:<textarea name="content" cols=80 rows=15>
hk_c:
你好!
</textarea><br>
<input type="submit" value="寄出">
<input type="reset" value="重写"><br>
</form>
<hr color="blue">
</body>
</html>###########------------文件二:mail.php-------########
<?
if (empty($from)||empty($subject)||empty($content))
{echo "没有完成填写,请<a href=\"mail.html\">返回</a>";} $body=$content;
//假设你有新浪邮箱[email protected]
//假设你还有新浪邮箱[email protected]
//同时寄两封当然功能强大点
$deal=mail("[email protected]",$subject,$body,"From:$from");
$deal2=mail("[email protected]",$subject,$body,"From:$from");
if($deal1) {echo "寄件成功!";}else{echo "寄件失败!!!";}
if($deal2) {echo "寄件成功!";}else{echo "寄件失败!!!";}
?>
文件一:mail.html
文件二:mail.php
记得把她们放在同一目录下!!!!!
假设你有新浪邮箱[email protected]###########------------文件一:mail.html-------########
<html><head><title>发信给hk_c</title></head>
<body>
<h2 align="center">hk_c发信界面</h2>
<hr color="blue">
<center>
<form action="mail.php">
发件人:<input type="text" name="from" size=25 [email protected]><br>
主题:<input type="text" name="subject" size=20><br>
内容:<textarea name="content" cols=80 rows=15>
hk_c:
你好!
</textarea><br>
<input type="submit" value="寄出">
<input type="reset" value="重写"><br>
</form>
<hr color="blue">
</body>
</html>###########------------文件二:mail.php-------########
<?
if (empty($from)||empty($subject)||empty($content))
{echo "没有完成填写,请<a href=\"mail.html\">返回</a>";} $body=$content;
//假设你有新浪邮箱[email protected]
//假设你还有新浪邮箱[email protected]
//同时寄两封当然功能强大点
$deal=mail("[email protected]",$subject,$body,"From:$from");
$deal2=mail("[email protected]",$subject,$body,"From:$from");
if($deal1) {echo "寄件成功!";}else{echo "寄件失败!!!";}
if($deal2) {echo "寄件成功!";}else{echo "寄件失败!!!";}
?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货