asp使用Jmail组件发送信息到指定邮箱
|
admin
2010年7月3日 10:52
本文热度 6486
|
[p]jmail.html [br] [br] [br]
信息反馈表 [br]
[br] [br][br] [br]
[br][br] [br] [br][br][br][br]send.asp [br] [br] [br]
发送表单 [br] [br][br]<% [br]name = request.form ("name") [br]email= request.form ("email") [br]address= request.form ("address") [br]mailsubject= request.form ("mailsubject") [br]text1 = request.form ("text1") [br]text2 = request.form ("text2") [br]text3 = request.form ("text3") [br]%> [br][br]<% [br]' 创建jmail对象: [br]set jmail = server.createobject("jmail.smtpmail") [br][br]' 设置发送邮件服务器(smtp): [br]jmail.serveraddress = "mail.abc.com:25" [br][br]' 发件人的信箱: [br]jmail.sender = email [br][br]' 邮件标题: [br]jmail.subject = mailsubject [br][br]' 设置邮件的收件人信箱 [br]jmail.addrecipient "abc@abc.com" [br][br]' 下面就是填表在内容区填写的内容,&是连接符,vbcrlf表示换行回车: [br][br]mess = mess & "---------------webmail表单开始-------------------" & vbcrlf [br]mess = mess & "留言人姓名:" & name & vbcrlf [br]mess = mess & "留言人邮件:" & email & vbcrlf [br]mess = mess & "留言人地址:" & address & vbcrlf [br]mess = mess & "留言内容一:" & text1 & vbcrlf [br]mess = mess & "留言内容二:" & text2 & vbcrlf [br]mess = mess & "留言内容三:" & text3 & vbcrlf [br]mess = mess & "---------------webmail表单结束-------------------" [br]jmail.body = mess [br][br]' 设置邮件的优先级(1-5,1为最高): [br]jmail.priority = 1 [br][br]' 执行发送任务: [br]jmail.execute [br]%> [br][br][br]您递交邮件已顺利发出,感谢您的意见和建议! [br] [br] [/p]
该文章在 2010/7/3 10:52:03 编辑过