- 域名頻道首頁(yè)
- 客服中心
- 常見(jiàn)問(wèn)題
- 企業(yè)郵局
- 其他
- Jmail 發(fā)送郵件的例子2
Jmail 發(fā)送郵件的例子2
<%@ Language=VBScript %>
<%
"==================================================
" 參 數(shù) 設(shè) 置
"==================================================
"修改收信人電子郵件地址,表單里的內(nèi)容將發(fā)送到這個(gè)信箱中
myemail ="test@test.com"
"修改收信人姓名
myname ="我的公司"
"修改SMTP
smtpserver ="mail.test.com"
"修改SMTP
smtpuser ="test@test.com"
smtppwd ="123456"
"與相應(yīng)SMTP
"很多SMTP
"比如163.net的SMTP
"結(jié)尾,否則不予發(fā)送,因此,使用相應(yīng)的信箱做為發(fā)信人信箱是必要的
smtpemail ="test@test.com"
"==================================================
" 程 序 開(kāi) 始
"==================================================
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 ="網(wǎng)上提交:" & tsubject
jmail.Body =tbody & vbcrlf & vbcrlf & "聯(lián)系方式:" & tother
jmail.AddRecipient myemail,myname
jmail.MailServerUserName =smtpuser
jmail.MailServerPassWord =smtppwd
isgo=jmail.Send(smtpserver)
if isgo then
msg="提交成功!謝謝您的支持。"
else
msg="發(fā)送失!請(qǐng)檢查您的郵件地址是否填寫(xiě)正確。"
end if
jmail.Close
set jmail=nothing
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>與我司聯(lián)系</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>電子郵件:
<br><input name=T2 size=29>
<br>聯(lián)系方式:
<br><input name=T3 size=29>
<br>文章主題:
<br><input name=T4 size=29>
<br>文章正文:
<br><textarea rows=6 cols=28 name=T5>
</textarea>
<br><input type="submit" value="確定">
</form>
</body></html>