<%@ Language=VBScript %>
<%
"==================================================
" 参 数 设 置
"==================================================
"修改收信人電(diàn)子邮件地址,表单里的内容将发送到这个信箱中
myemail ="test@test.com"
"修改收信人姓名
myname ="我的公司"
"修改SMTP服務(wù)器
smtpserver ="mail.test.com"
"修改SMTP服務(wù)器的用(yòng)户名和密码
smtpuser ="test@test.com"
smtppwd ="123456"
"与相应SMTP服務(wù)器对应的邮件地址
"很(hěn)多(duō)SMTP服務(wù)器除了要验证用(yòng)户名和密码外,还要验证发件人地址,
"比如163.net的SMTP服務(wù)器在检查发信人邮件地址是不是以163.net
"结尾,否则不予发送,因此,使用(yòng)相应的信箱做為(wèi)发信人信箱是必要的
smtpemail ="test@test.com"
"==================================================
" 程 序 开 始
"==================================================
tname =Request("t1")
temail =Request("t2")
tother =Request("t3")
tsubject =Request("t4")
tbody =Request("t5")
if tname <> "" and temail <> "" then
set jmail=server.CreateObject ("jmail.message")
jmail.Silent =true
jmail.Charset ="gb2312"
if smtpemail <> "" then
jmail.From ="test@test.com"
else
jmail.From =temail
end if
jmail.FromName =tname
jmail.ReplyTo =temail
jmail.Subject ="网上提交:" & tsubject
jmail.Body =tbody & vbcrlf & vbcrlf & "联系方式:" & tother
jmail.AddRecipient myemail,myname
jmail.MailServerUserName =smtpuser
jmail.MailServerPassWord =smtppwd
isgo=jmail.Send(smtpserver)
if isgo then
msg="提交成功!謝(xiè)謝(xiè)您的支持。"
else
msg="发送失败!请检查您的邮件地址是否填写正确。"
end if
jmail.Close
set jmail=nothing
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>与我司联系</title>
</head>
<style type="text/css">
<!--
body,input,textarea{font-size: 12px}
-->
</style>
<body>
<form action=jmail.asp><%=msg%>
<br>您的姓名:
<br><input name=T1 size=29>
<br>電(diàn)子邮件:
<br><input name=T2 size=29>
<br>联系方式:
<br><input name=T3 size=29>
<br>文(wén)章主题:
<br><input name=T4 size=29>
<br>文(wén)章正文(wén):
<br><textarea rows=6 cols=28 name=T5>
</textarea>
<br><input type="submit" value="确定">
</form>
</body></html>