(1)Body(信件正文): 字符串
如:JMail.Body = "这里可以是用户填写的表单内容,可以取自From。"
(2)Charset(字符集,缺省为"US-ASCII"): 字符串
如:JMail.Charset = "US-ASCII"
(3)ContentTransferEncoding : 字符串
指定内容传送时的编码方式,缺省是"Quoted-Printable",如:JMail.ContentTransferEncoding = "base64"
(4)ContentType(信件的contentype. 缺省是"text/plain"): 字符串
如果你以HTML格式发送邮件, 改为"text/html"即可。如:JMail.ContentType = "text/html"
(5)Encoding : 字符串
设置附件编码方式(缺省是"base64)。可以选择使用的是"base64", "uuencode" or "quoted-printable"。如:JMail.Encoding = "base64"
(6)Log(Jmail创建的日志,前提loging属性设置为true,见下面): 字符串
如:使用Response.Write( JMail.Log )语句列出日志信息。
(7)Logging(是否使用日志): 布尔型
如:JMail.Logging = true
(8)Recipients : 字符串
只读属性,返回所有收件人。如:Response.Write( "" + JMail.Recipients + "" );
(9)ReplyTo(指定别的回信地址): 字符串
如:JMail.ReplyTo = "anyother@mailhost.com"
(10)Sender( 发件人的邮件地址): 字符串
如:JMail.Sender = "sender@mailhost.com"
(11)SenderName(发件人的姓名): 字符串
如:JMail.SenderName = "一克"
(12)ServerAddress(邮件服务器的地址): 字符串
你可以指定多个服务器,用分号点开。可以指定端口号。如果serverAddress保持空白,JMail会尝试远程邮件服务器,然后直接发送到服务器上去。如:JMail.ServerAddress = "mail.263.net.cn"
(13)Subject(设定邮件的标题,可以取自From。):字符串
如:JMail.Subject = "客户反馈表单"
(14)添加文件附件到邮件
如:JMail.AddAttachment( "c:\anyfile.zip" )
(15)AddCustomAttachment( FileName, Data )
添加自定义附件。如:JMail.AddCustomAttachment( "anyfile.txt", "Contents of file" );
(16)AddHeader( Header, Value )
添加用户定义的信件标头。如:JMail.AddHeader( "Originating-IP","192.168.10.10" );
(17)AddRecipient(收件人):字符串
如:JMail.AddRecipient( "info@dimac.net" );
(18)AddRecipientBCC( Email ),密件收件人:
如:JMail.AddRecipientBCC( "anyone@mailhost.com" );
(19)AddRecipientCC( Email ) ,抄送收件人:
如:JMail.AddRecipientCC( "anyone@mailhost.com" )
(20)AddURLAttachment( URL, 文档名)
下载并添加一个来自url的附件. 第二个参数"文档名", 用来指定信件收到后的文件名。如:JMail.AddURLAttachment( "http://www.webjx.com/jmail.zip", "jmail" )
(21)AppendBodyFromFile( 文件名) ,将文件作为信件正文:
如:JMail.AppendBodyFromFile( "c:\anyfile.txt" )
(22)AppendText( Text )
追加信件的正文内容,比如增加问候语或者其它信息。如:JMail.AppendText( "欢迎访问本站!" )
(23)Close() ,强制JMail关闭缓冲的与邮件服务器的连接:
如:JMail.Close()
(24)Execute() ,执行邮件的发送
如:JMail.Execute()
下面是忘记密码时的程序代码:
path=Server.MapPath("\images\logo.gif")
Set JMail=Server.CreateObject("JMail.SMTPMail")
JMail.ContentType="text/html"
JMail.Encoding = "base64"
JMail.Charset="gb2312"
JMail.ServerAddress = "mail.webjx.com"
JMail.Sender = "web@webjx.com"
JMail.Subject = "webjx.com发给您的密码!"
JMail.AddRecipient(email)
JMail.Body =str
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.AddAttachment(path)
JMail.Execute
JMail.Close
Set JMail = Nothing