Jmail中文使用说明 附 使用 源码.docx

上传人:b****5 文档编号:5150698 上传时间:2022-12-13 格式:DOCX 页数:11 大小:21.65KB
下载 相关 举报
Jmail中文使用说明 附 使用 源码.docx_第1页
第1页 / 共11页
Jmail中文使用说明 附 使用 源码.docx_第2页
第2页 / 共11页
Jmail中文使用说明 附 使用 源码.docx_第3页
第3页 / 共11页
Jmail中文使用说明 附 使用 源码.docx_第4页
第4页 / 共11页
Jmail中文使用说明 附 使用 源码.docx_第5页
第5页 / 共11页
点击查看更多>>
下载资源
资源描述

Jmail中文使用说明 附 使用 源码.docx

《Jmail中文使用说明 附 使用 源码.docx》由会员分享,可在线阅读,更多相关《Jmail中文使用说明 附 使用 源码.docx(11页珍藏版)》请在冰豆网上搜索。

Jmail中文使用说明 附 使用 源码.docx

Jmail中文使用说明附使用源码

W3Jmail中文使用说明

W3Jmail使用说明

jmail.smtpmail

Body:

String

(v3.0)

信件体,正文,使用AppendText追加内容

如:

JMail.Body="Helloworld"

Charset:

String

(v3.0)

字符集,缺省为"US-ASCII"

如:

JMail.Charset="US-ASCII"

ContentTransferEncoding:

String

(v3.0)

指定内容传送时的编码方式,缺省是"Quoted-Printable"

如:

JMail.ContentTransferEncoding="base64"

ContentType:

String

(v3.0)

信件的contentype.缺省是"text/plain",但是可以设置为其他你想要的类型.

如果你以HTML格式发送邮件,改为"text/html"即可。

如:

JMail.ContentType="text/html"

DeferredDelivery:

Date

(v3.0)

设置延期发送.如果邮件服务器支持的话,消息到了这个时间才会发送

如:

(Javascript)JMail.DeferredDelivery=newDate(2000,02,17).getVarDate();

Encoding:

String

(v3.0)

这个属性可以用来改变附件编码方式(缺省是"base64).可以选择使用的是"base64","uuencode"or"quoted-

printable"

如:

JMail.Encoding="base64"

ErrorCode:

Integer

(v3.0)

如果JMail.silent设置为true,ErrorCode包含的是错误代码

如:

Response.Write(JMail.ErrorCode);

ErrorMessage:

String

(v3.0)

如果JMail.silent设置为true,包含的是错误信息

如:

Response.Write(JMail.ErrorMessage);

ErrorSource:

String

(v3.0)

ContainstheerrorsourceifJMail.silentissettotrue

如:

Response.Write(JMail.ErrorSource);

ISOEncodeHeaders:

Boolean

(v3.0)

是否将信头编码成iso-8859-1字符集.缺省是true

如:

JMail.ISOEncodeHeaders=false

Lazysend:

Boolean

(v3.0)

这个属性指定Jmail是否一直等到mail发送了然后返回,或者缓冲这条消息然后在后台发送。

然而设置了这个属性,你就不能控制错误信息。

注意:

如果选择了这个选项,属性ServerAddress将无效,lazysend将通过dsn查询决定邮件服务器,

在一些设置里面,这可能有问题。

如:

JMail.LazySend=true;

Log:

String

(v3.0)

Jmail创建的日志,如果loging属性设置为true

如:

Response.Write(JMail.Log);

Logging:

Boolean

(v3.0)

是否使用日志

如:

JMail.Logging=true

MailDomain:

String

(v3.0)

ThiscanbeusedtooverridetheEHLO/HELOstatementtoyourmailserver

如:

JMail.Maildomain=""

MimeVersion:

String

(v3.0)

指定mime版本。

缺省是"1.0"

如:

JMail.MimeVersion="1.0"

Priority:

Integer

(v3.0)

优先级.范围在1-5之间

1高优先级.有些邮件程序称之为紧急

2也是高优先级

3普通优先级

4低优先级

5最低的优先级

如:

JMail.Priority=3

Recipients:

String

(v3.0)

只读属性,返回所有收件人

如:

Response.Write(""+JMail.Recipients+"");

ReplyTo:

String

(v3.0)

指定一个可选的回信地址

如:

JMail.ReplyTo="president@"

ReturnReceipt:

Boolean

(v3.0)

指定是否发件人需要一个回复收据.缺省是false

如:

JMail.ReturnReceipt=true

Sender:

String

(v3.0)

指定发件人的邮件地址

如:

JMail.Sender="batman@"

SenderName:

String

(v3.0)

指定发件人的姓名

如:

JMail.SenderName="Batman"

ServerAddress:

String

(v3.0)

指定邮件服务器的地址。

可以指定多个服务器,用分号点开。

可以指定端口号。

如果serverAddress保持空白,JMail会尝试解决远程邮件服务器,然后直接发送到服务器上去。

如:

JMail.ServerAddress=";:

2500"

Silent:

Boolean

(v3.0)

如果设置为true,JMail不会抛出例外错误.JMail.execute()会根据操作结果返回true或false

如:

JMail.silent=true

SimpleLayout:

Boolean

(v3.0)

设置为true,减少Jmail产生的header信头

如:

JMail.SimpleLayout=true

Subject:

String

(v3.0)

设定消息的标题

如:

JMail.Subject="Dimacrocksbigtime!

"

UsePipelining:

Boolean

(v3.0)

OverridesifJMailshouldusepipeliningonaserverthatsupportsit.

如:

JMail.Pipelining=false

AddAttachment(FileName,[ContentType])

(v3.0)

添加文件附件到信件

如:

JMail.AddAttachment("c:

\\autoexec.bat");

AddCustomAttachment(FileName,Data)

(v3.0)

添加自定义附件.Thiscanbeusedtoattach"virtualfiles"likeageneratedtextstringor

certificateetc.

如:

JMail.AddCustomAttachment("readme.txt","Contentsoffile");

AddHeader(XHeader,Value)

(v3.0)

添加用户定义的X-header到message

如:

JMail.AddHeader("Originating-IP","193.15.14.623");

AddNativeHeader(Header,Value)

(v3.0)

添加信头

如:

JMail.AddNativeHeader("MTA-Settings","route");

AddRecipient(Email)

(v3.0)

增加收件人

如:

JMail.AddRecipient("info@");

AddRecipientBCC(Email)

(v3.0)

增加密件收件人

如:

JMail.AddRecipientBCC("someone@");

AddRecipientCC(Email)

(v3.0)

增加抄送收件人

如:

JMail.AddRecipientCC("someone@");

AddRecipientEx(Email,Name)

(v3.0)

增加一个带名字的收件人

如:

JMail.AddRecipientEx("info@","DimacINFO");

AddURLAttachment(bstrURL,bstrAttachAs,[bstrAuth])

(v3.0)

下载并添加一个来自url的附件.第二个参数"AttachAs",被用来指定信件收到后的文件名.第3个可选参数是用

来可选的WWW-鉴定.

如:

JMail.AddURLAttachment(""jmail.exe")

AppendBodyFromFile(FileName)

(v3.0)

将一个文件内容追加到正文后

如:

JMail.AppendBodyFromFile("c:

\\mytext.txt");

AppendText(Text)

(v3.0)

追加信件的正文内容

如:

JMail.AppendText("TextappendedtomessageBody");

ClearAttachments()

(v3.0)

清除附件列表

如:

JMail.ClearAttachments();

ClearCustomHeaders()

(v3.0)

清除所有自定义的信头

如:

JMail.ClearCustomHeaders();

ClearRecipients()

(v3.0)

清除收件人列表

如:

JMail.ClearRecipients();

Close()

(v3.0)

强制JMail关闭缓冲的与邮件服务器的连接

如:

JMail.Close();

Execute():

Boolean

(v3.0)

执行邮件的发送

如:

JMail.Execute();

ExtractEmailAddressesFromURL(bstrURL,[bstrAuth])

(v3.0)

从一个url下载和添加email地址

如:

JMail.ExtractEmailAddressesFromURL("http:

//duplo.org/generateEmailList.asp");

GetMessageBodyFromURL(bstrURL,[bstrAuth])

(v3.0)

清除message的正文,并用url的内容替换。

Contenttype会自动设置成URl的contentyp。

第二参数(loginand

password)是可选的。

如:

JMail.GetMessageBodyFromURL("http:

//duplo.org/","login:

password")

LogCustomMessage(Message)

(v3.0)

将用户自定义消息加入JMail日志.只有属性loging设置为true时,这项功能才能起作用

如:

JMail.LogCustomMessage("Helloworld");

W3Jmail使用范例

日期:

2001年6月15日作者:

不详人气:

1096查看:

[大字体中字体小字体]

Confirmation

<%

SetJMail=Server.CreateObject("JMail.SMTPMail")

'ThisismylocalSMTPserver

JMail.ServerAddress=":

25"

'Thisisme....

JMail.Sender="myemail@"

JMail.Subject="Hereyougo..."

'Gettherecipientsmailboxfromaform(notethelackofaequalsign).

JMail.AddRecipient"mum@"

JMail.AddRecipient"dad@"

'Thebodypropertyisbothreadandwrite.

'Ifyouwanttoappendtexttothebodyyoucan

'useJMail.Body=JMail.Body&"Helloworld!

"

'oryoucanuseJMail.AppendText"HelloWorld!

"

'whichinmanycasesiseasiertouse.

JMail.Body="Hereyougo.Yourrequesthasbeenapproved"&_

"andtheprogramisattachedtothismessage"

'1-highestpriority(Urgent)

'3-normal

'5-lowest

JMail.Priority=1

JMail.AddHeader"Originating-IP",Request.ServerVariables("REMOTE_ADDR")

'MustmakesurethatIUSR_?

?

?

?

hasaccesstothefollowingfiles.

JMail.AppendBodyFromFile"e:

\mail\standard_footer.txt"

JMail.AddAttachment"e:

\products\MyProduct.exe"

'Sendit...

JMail.Execute

%>

Ane-mailhasbeensenttoyourmailbox(<%=request.form("email")%>).

w3upload组件实例应用1

日期:

2001年6月15日作者:

不详人气:

411查看:

[大字体中字体小字体]

文件1-Upload.asp

w3Upload

用w3upload组件上传


Chooseaname:


文件2-UploadProcess.asp

<%@LANGUAGE="VBSCRIPT"%>

<%

Setupload=Server.CreateObject("w3.upload")

actualName=upload.Form("name")

SetfileName=upload.Form("thefile")

iffileName.IsFilethen

fileName.SaveToFile(Request.ServerVariables("APPL_PHYSICAL_PATH")&"\\"&actualName)

endif

%>

w3Upload



Finished!




用Jmail做收取邮件附件的程序

日期:

2001年9月5日作者:

不详人气:

1523查看:

[大字体中字体小字体]

我现在自己在用asp做一个web邮件处理程序,就和网上263,163的web电子邮箱。

我在制作自己的web邮件系统的时候,使用的是网上很流行的asp邮件处理组件aspmail和jmail分别作web邮件的发件和收件程序,现在的问题就是我在用我做的web收件程序收一个带有附件的邮件的时候,下载下来的附件会被损坏(比如说:

我在邮件中粘贴一个50k大小的jpg图片附件,但用web程序收下来的时候图片大小就变成40k的了,并且图片打开后看不到东西),我原先是以为jmail这个收邮件组件本身有Bug,但我又用了其他的用在asp里的收邮件组件,还是老样子。

另外需要说明的是邮件本身没问题,我用邮件客户端软件收这个邮件时都没问题。

下面是我的程序的一个demo,不知道你有没有这方面的编程经验,帮我解决这个问题。

<%@LANGUAGE=VBSCRIPT%>

<%

Setpop3=Server.CreateObject("JMail.POP3")'创建对象

pop3.Connect"pzhou","pzhou","10.157.11.42"'连接服务器pop3.connectuser,password,host

Response.Write("Youhave"&pop3.count&"mailsinyourmailbox!



")

setmsg=server.CreateObject("jmail.message")

ifpop3.count>0then

Setmsg=pop3.Messages.item

(1)

separator=","

FunctiongetAttachments()'获得附件

SetAttachments=msg.Attachments

separator=","

Response.Write"
"&msg.size&"
"

Fori=0ToAttachments.Count-1

Ifi=Attachments.Count-1Then

separator=""

EndIf

Setat=Attachments(i)

at.SaveToFile("e:

\"&at.Name)

getAttachments=getAttachments&""&_

at.Name&"("&at.Size&"bytes)"&""&separator

Next

EndFunction

%>

Subject<%=msg.Subject%>
From<%=msg.FromName%>
Attachments<%=getAttachments%>
Body
<%=msg.Body%>

<%

endif

pop3.Disconnect

%>

ZaksPop3参考说明

日期:

2001年6月15日作者:

不详人气:

239查看:

[大字体中字体小字体]

对象的属性及方法:

所有代码段都必须调用该语句

setpop3=Server.CreateObject("zakspop3.Server")

Property:

mailServerHost:

theIPAddressofthePOP3Server.

属性:

mailServerHost:

POP3服务器的IP地址

Property:

mailAccount:

TheusernameofthePOP3mailbox.

属性:

mailAccount:

POP3邮箱的用户名

Property:

mailPassword:

Thepasswordofthemailbox.属性:

mailPassword:

邮箱的密码

Property:

mailPort:

defaultto110,thestandardportforthePOP3protocol

属性:

mailPort:

默认值为110,POP3协议的标准端口

Property:

errorString:

Anerrordescription,shouldanerroroccur.

属性:

errorString:

错误发生后的错误描述

Property:

useUIDL:

settotruetoenableUIDLsupport(defaultstofalse).

属性:

useUIDL:

值为真时,支持UIDL,默认值为假

Function:

Login:

Attempttoconnecttothemailserver&mailbox,returntrueforsuccess,falseforerror

函数:

Login:

和邮件服务器及邮箱建立连接,连接成功返回True,出错时返回False

Function:

FetchHeaders:

Getthecurrentmessageheadersfromthemailserver

函数:

FetchHeaders:

从邮件服务器读取邮件标头

Function:

Delete(msgID):

Deletesthespecifiedmessagefromthemailserver

函数:

Delete(msgID):

从邮件服务器删除指定邮件

Collecti

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 艺术

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1