如何利用ASP程序来使用JMail发邮件的例子
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
if Request("MailtoAddress") <> "" then
msg = SendMail
(Request("SMTPServer"),Request("SMTPServerUserName"),Request("SMTPServerPassword"),
Request("MailDomain"),Request("MailtoAddress"),Request("MailtoName"),Request("Subject"),
Request("MailBody"),Request("fromName"),Request("Mailfrom"),Request("Priority"))
if msg then Response.Write("发送成功") else Response.Write("发送不成功")
Response.End()
end if
function
SendMail(SMTPServer,SMTPServerUserName,SMTPServerPassword,MailDomain,MailtoAddress,MailtoName,
Subject,MailBody,fromName,Mailfrom,Priority)
dim JMail, msg
set JMail=Server.CreateObject("JMail.Message")
JMail.Charset="gb2312" '编码
JMail.silent=true '设置为true,JMail不会抛出例外错误.
JMail.ContentType = "text/plain" '邮件正文格式
'JMail.ServerAddress = SMTPServer '用来发送邮件的SMTP服务器(无效)
'指定邮件服务器的地址。可以指定多个服务器,用分号点开。可以指定端口号。
'如果serverAddress保持空白,JMail会尝试解决远程邮件服务器,然后直接发送到服务器上去。???
'如:JMail.ServerAddress = &tquo;mail.mydom.net; mail2.mydom.net:2500"
JMail.MailServerUserName = SMTPServerUserName ' 登录用户名
JMail.MailServerPassWord = SMTPServerPassword ' 登录密码
JMail.MailDomain = MailDomain '域名(如果用 “name@domain.com”这样的用户名登录时,请指明domain.com
JMail.AddRecipient MailtoAddress,MailtoName '收信人
JMail.Subject = Subject '主题
JMail.Body = MailBody '邮件正文(纯文本格式)
JMail.fromName = fromName '发信人姓名
JMail.from = Mailfrom '发信人Email
JMail.Priority = Priority '邮件等级12345
msg = JMail.Send(
相关文档:
LBound() 函数: 返回指定的数组维可用的最小下标。
UBound() 函数: 返回指定的数组维可用的最大下标。
InStr([start, ]string1, string2[, compare]) 返回字符或字符串在另一个字符串中第一次出现的位置
InStrRev()函数 返回某字符串在另一个字符串中最后出现的位置
CDate() 函数可把一个合法的日期和时间表达式转换为 ......
<%
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.GetFolder("c:\Program Files")
Response.Write "父文件夹名字是:" & fldr & "<br>"
If fldr.IsRootFolder = True Then
Response.Write "该文件夹是一根文件夹" & "<br>"
Else
Resp ......
<style type="text/css">
.container, .container *{margin:0; padding:0;}
.container{width:325px; height:287px; overflow:hidden;position:relative; margin-left:5px; margin-top:6px;}
.slider{position:absolute;}
.slider li{ list-style:none;display:inline;}
.slider img{ width:325px; height:287p ......
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%response.ContentType ="application/vnd.ms-excel"
%>
<%
Set xlApplication = Server.CreateObject("Excel.Application") '调用excel对象
xlApplication.Visible = False '无需打开excel
xlApplication.SheetsInN ......
asp连接access和mssql的万能代码:
'解决了ACCESS数据库路径的问题!
'采用DBType=0或DBType=1来区分AC库还是MSSQL库
'具体采用AC库时应注意的事项,请看程序说明
-----------------------------------------------
Dim DBType,Conn,StrConn
DBType=0 '0为Access数据库,1为MSSQL数据库
If(DBType=0) Then
......