<%
' smtpHost 发送邮箱的SMTP, 例: smtp.163.com
' smtpUser 发送的邮箱
' smtpPass 发件箱的密码
' mailTo 接收邮件的 邮箱
' FromName 发件人的名字
' subject 邮件主题
' content 邮件内容
Function Send_Email(smtpHost,smtpUser,smtpPass,mailTo,FromName,subject,content)
Set jmail = Server.CreateObject("JMAIL.Message")
jmail.silent = true
jmail.logging = true
jmail.Charset = "gb2312"
jmail.ContentType = "text/html"
jmail.AddRecipient mailTo ' 邮件收件人的地址
jmail.From = smtpUser '发件人的E-MAIL地址
jmail.FromName = FromName
jmail.Subject = subject
jmail.Body = content
jmail.Priority = 1
jmail.MailServerUserName = smtpUser
jmail.MailServerPassword = smtpPass
jmail.Send(smtpHost)
isgo=jmail.Send(smtpHost)
if isgo then
RESPONSE.WRITE("已将密码发送到你的保密邮箱!请及时检查你的邮箱。")
else
RESPONSE.WRITE("发送邮件失败!请检查你的邮箱。")
end if
jmail.Close()
set jmail=nothing
'response.write("邮件发送成功")
End Function
Call Send_EMail("smtp.126.com","leaderhelen@126.com","leaderhelen邮箱的密码","testname@126.com","万超星管理员","密码","请用此密码登陆并第一时间修改此密码!")
%>
posted on 2006-12-14 13:01
汪杰 阅读(226)
评论(0) 编辑 收藏 引用 所属分类:
asp(javascrpt)