28,391
社区成员
发帖
与我相关
我的任务
分享
<form action="sendmail.asp" method="post" enctype="text/plain" name="guestbook" id="guestbook" onsubmit="MM_validateForm('Guest_Name','','R','Guest_Email','','RisEmail','Content','','R');return document.MM_returnValue">
<dl class="clearfix">
<dt>您的姓名:</dt>
<dd><input name="Guest_Name" type="text" id="Guest_Name" /><span>*</span></dd>
<dt>邮件地址:</dt>
<dd><input name="Guest_Email" type="text" id="Guest_Email" /><span>*</span></dd>
<dt>留言内容:</dt>
<dd><textarea name="Content" cols="" rows="" class="Content" id="Content"></textarea></dd>
</dl>
<p>
<input type="submit" name="submit" id="submit" value="提交" />
</p>
</form>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>发送邮件</title>
</head>
<body>
<%
dim Guest_Name,Guest_Email,Content,msg,JMail
Guest_Name==request.Form("Guest_Name")
Guest_Email=request.Form("Guest_Email")
Content=request.Form("Content")
msg = ""
msg = msg & "Guest_Name:" & Guest_Name & vbcrlf
msg = msg & "Guest_Email:" & Guest_Email & vbcrlf
msg = msg & "Content:" & Content & vbcrlf
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.silent = true
JMail.logging = true
JMail.Charset = "GB2312"
JMail.ContentType = "text/plain"
JMail.ServerAddress = "smtp.****.com.cn"
JMail.AddRecipient ****@****.com.cn
JMail.SenderName = Guest_Name
JMail.Sender = "****@****.com.cn"
JMail.Priority = 3
JMail.Subject = "来自网站留言簿"
JMail.Body = msg
JMail.Execute()
' 关闭并清除对象
JMail.Close()
Set JMail = Nothing
%>
<CENTER>非常感谢您提交的留言信息!</CENTER>
<p align="center">--- < <a href="guestbook.html">点击此处返回网页</a>> ---</p>
</body>
</html>
<%
set mail=CreateObject("jmail.Message")
mail.Charset ="gb2312"
mail.From ="******"
mail.AddRecipient "******"
mail.MailDomain="******"
mail.MailServerUserName = "******"
mail.MailServerPassWord = "******"
mail.subject="hi"
mail.body= "hi china.com"
'On Error Resume Next
flag = mail.Send("******")
mail.close()
set mail=nothing
if mail then
response.write "发送成功"
else
response.write "发送失败"
end if
%>