www.pudn.com > QQ.zip > sendmail.asp, change:2009-07-13,size:1424b


<%@LANGUAGE = VBSCRIPT%>  
<html> 
<body> 
<% 
recipient = Request.Form("sendemail") '此为收信人电子邮箱  
name = Request.Form("name") 
senderEmail = Request.Form("email") 
subject = Request.Form("subject") 
body = Request.Form("body") 
 
mailserverusername = Request.Form("mailserverusername") 'Smtp服务器邮件 
mailserverpassword = Request.Form("mailserverpassword") 'Smtp服务器密码 
 
if name <> "" and senderEmail <> "" and body<>"" then 
 
'建立 JMail 组件 
set msg = Server.CreateOBject( "JMail.Message" ) 
 
 
'设定将寄信的过程记录下来 
msg.Logging = true 
msg.silent = true 
 
 
'中文编码设定 
msg.Charset = "gb2312" 
 
 
'将表单资料存入组件中 
msg.From = senderEmail 
msg.FromName = name 
 
 
'smtp认证的关键 
msg.mailserverusername= mailserverusername '邮箱账户,需完整地址 
msg.mailserverpassword= mailserverpassword '输入你的邮箱密码 
 
 
'将收信人的资料加入组件 
msg.AddRecipient recipient 
 
 
'设定信件的主题 
msg.Subject = subject 
 
 
'设定信件的主体内容 
msg.htmlbody = body 
 
 
'送出表单资料为电子邮件 ,并指定发信服务器 SMTP 
if not msg.Send ("mail.qyky.net") then 
Response.write "<pre>" & msg.log & "</pre>" 
else 
Response.write "信件已成功发送!!" 
Response.write "<a href=javascript:history.go(-1)>返回</a>" 
end if 
 
 
msg.Close 
set msg=nothing 
else  
response.write "对不起,邮件发送失败,可能由于服务器登录设置配置不当造成或填写的信息有误,请确认正确后再进行发送!" 
end if 
%> 
</body> 
</html>