Jmail中文使用说明 附 使用 源码Word格式文档下载.docx
《Jmail中文使用说明 附 使用 源码Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《Jmail中文使用说明 附 使用 源码Word格式文档下载.docx(11页珍藏版)》请在冰豆网上搜索。
如果JMail.silent设置为true,ErrorCode包含的是错误代码
Response.Write(JMail.ErrorCode);
ErrorMessage:
如果JMail.silent设置为true,包含的是错误信息
Response.Write(JMail.ErrorMessage);
ErrorSource:
ContainstheerrorsourceifJMail.silentissettotrue
Response.Write(JMail.ErrorSource);
ISOEncodeHeaders:
Boolean
是否将信头编码成iso-8859-1字符集.缺省是true
JMail.ISOEncodeHeaders=false
Lazysend:
这个属性指定Jmail是否一直等到mail发送了然后返回,或者缓冲这条消息然后在后台发送。
然而设置了这个属性,你就不能控制错误信息。
注意:
如果选择了这个选项,属性ServerAddress将无效,lazysend将通过dsn查询决定邮件服务器,
在一些设置里面,这可能有问题。
JMail.LazySend=true;
Log:
Jmail创建的日志,如果loging属性设置为true
Response.Write(JMail.Log);
Logging:
是否使用日志
JMail.Logging=true
MailDomain:
ThiscanbeusedtooverridetheEHLO/HELOstatementtoyourmailserver
JMail.Maildomain="
"
MimeVersion:
指定mime版本。
缺省是"
1.0"
JMail.MimeVersion="
Priority:
优先级.范围在1-5之间
1高优先级.有些邮件程序称之为紧急
2也是高优先级
3普通优先级
4低优先级
5最低的优先级
JMail.Priority=3
Recipients:
只读属性,返回所有收件人
Response.Write("
+JMail.Recipients+"
);
ReplyTo:
指定一个可选的回信地址
JMail.ReplyTo="
president@"
ReturnReceipt:
指定是否发件人需要一个回复收据.缺省是false
JMail.ReturnReceipt=true
Sender:
指定发件人的邮件地址
JMail.Sender="
batman@"
SenderName:
指定发件人的姓名
JMail.SenderName="
Batman"
ServerAddress:
指定邮件服务器的地址。
可以指定多个服务器,用分号点开。
可以指定端口号。
如果serverAddress保持空白,JMail会尝试解决远程邮件服务器,然后直接发送到服务器上去。
JMail.ServerAddress="
;
:
2500"
Silent:
如果设置为true,JMail不会抛出例外错误.JMail.execute()会根据操作结果返回true或false
JMail.silent=true
SimpleLayout:
设置为true,减少Jmail产生的header信头
JMail.SimpleLayout=true
Subject:
设定消息的标题
JMail.Subject="
Dimacrocksbigtime!
UsePipelining:
OverridesifJMailshouldusepipeliningonaserverthatsupportsit.
JMail.Pipelining=false
AddAttachment(FileName,[ContentType])
添加文件附件到信件
JMail.AddAttachment("
c:
\\autoexec.bat"
AddCustomAttachment(FileName,Data)
添加自定义附件.Thiscanbeusedtoattach"
virtualfiles"
likeageneratedtextstringor
certificateetc.
JMail.AddCustomAttachment("
readme.txt"
Contentsoffile"
AddHeader(XHeader,Value)
添加用户定义的X-header到message
JMail.AddHeader("
Originating-IP"
"
193.15.14.623"
AddNativeHeader(Header,Value)
添加信头
JMail.AddNativeHeader("
MTA-Settings"
route"
AddRecipient(Email)
增加收件人
JMail.AddRecipient("
info@"
AddRecipientBCC(Email)
增加密件收件人
JMail.AddRecipientBCC("
someone@"
AddRecipientCC(Email)
增加抄送收件人
JMail.AddRecipientCC("
AddRecipientEx(Email,Name)
增加一个带名字的收件人
JMail.AddRecipientEx("
DimacINFO"
AddURLAttachment(bstrURL,bstrAttachAs,[bstrAuth])
下载并添加一个来自url的附件.第二个参数"
AttachAs"
被用来指定信件收到后的文件名.第3个可选参数是用
来可选的WWW-鉴定.
JMail.AddURLAttachment("
"
jmail.exe"
)
AppendBodyFromFile(FileName)
将一个文件内容追加到正文后
JMail.AppendBodyFromFile("
\\mytext.txt"
AppendText(Text)
追加信件的正文内容
JMail.AppendText("
TextappendedtomessageBody"
ClearAttachments()
清除附件列表
JMail.ClearAttachments();
ClearCustomHeaders()
清除所有自定义的信头
JMail.ClearCustomHeaders();
ClearRecipients()
清除收件人列表
JMail.ClearRecipients();
Close()
强制JMail关闭缓冲的与邮件服务器的连接
JMail.Close();
Execute():
执行邮件的发送
JMail.Execute();
ExtractEmailAddressesFromURL(bstrURL,[bstrAuth])
从一个url下载和添加email地址
JMail.ExtractEmailAddressesFromURL("
http:
//duplo.org/generateEmailList.asp"
GetMessageBodyFromURL(bstrURL,[bstrAuth])
清除message的正文,并用url的内容替换。
Contenttype会自动设置成URl的contentyp。
第二参数(loginand
password)是可选的。
JMail.GetMessageBodyFromURL("
//duplo.org/"
login:
password"
LogCustomMessage(Message)
将用户自定义消息加入JMail日志.只有属性loging设置为true时,这项功能才能起作用
JMail.LogCustomMessage("
W3Jmail使用范例
日期:
2001年6月15日作者:
不详人气:
1096查看:
[大字体中字体小字体]
<
html>
head>
title>
Confirmation<
/title>
body>
%
SetJMail=Server.CreateObject("
JMail.SMTPMail"
)
'
ThisismylocalSMTPserver
:
25"
Thisisme....
myemail@"
Hereyougo..."
Gettherecipientsmailboxfromaform(notethelackofaequalsign).
JMail.AddRecipient"
mum@"
dad@"
Thebodypropertyisbothreadandwrite.
Ifyouwanttoappendtexttothebodyyoucan
useJMail.Body=JMail.Body&
Helloworld!
oryoucanuseJMail.AppendText"
HelloWorld!
whichinmanycasesiseasiertouse.
Hereyougo.Yourrequesthasbeenapproved"
&
_
andtheprogramisattachedtothismessage"
1-highestpriority(Urgent)
3-normal
5-lowest
JMail.Priority=1
JMail.AddHeader"
Request.ServerVariables("
REMOTE_ADDR"
)
MustmakesurethatIUSR_?
?
hasaccesstothefollowingfiles.
JMail.AppendBodyFromFile"
e:
\mail\standard_footer.txt"
JMail.AddAttachment"
\products\MyProduct.exe"
Sendit...
JMail.Execute
%>
center>
Ane-mailhasbeensenttoyourmailbox(<
%=request.form("
email"
)%>
).
/center>
/body>
/html>
w3upload组件实例应用1
411查看:
文件1-Upload.asp
w3Upload<
/head>
用w3upload组件上传
formaction="
UploadProcess.asp"
method="
post"
enctype="
multipart/form-data"
>
inputtype="
file"
name="
thefile"
br>
Chooseaname:
<
text"
name"
submit"
value="
Transmit"
/form>
文件2-UploadProcess.asp
%@LANGUAGE="
VBSCRIPT"
%>
Setupload=Server.CreateObject("
w3.upload"
)
actualName=upload.Form("
SetfileName=upload.Form("
iffileName.IsFilethen
fileName.SaveToFile(Request.ServerVariables("
APPL_PHYSICAL_PATH"
)&
\\"
actualName)
endif
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"
10.157.11.42"
'
连接服务器pop3.connectuser,password,host
Youhave"
pop3.count&
mailsinyourmailbox!
setmsg=server.CreateObject("
jmail.message"
ifpop3.count>
0then
Setmsg=pop3.Messages.item
(1)
separator="
FunctiongetAttachments()'
获得附件
SetAttachments=msg.Attachments
Response.Write"
&
msg.size&
Fori=0ToAttachments.Count-1
Ifi=Attachments.Count-1Then
EndIf
Setat=Attachments(i)
at.SaveToFile("
\"
at.Name)
getAttachments=getAttachments&
ahref="
at.Name&
at.Name&
("
at.Size&
bytes)"
/a>
separator
Next
EndFunction
TABLE>
tr>
td>
Subject<
/td>
%=msg.Subject%>
/tr>
From<
%=msg.FromName%>
Attachments<
%=getAttachments%>
Body<
pre>
%=msg.Body%>
/pre>
/TABLE>
endif
pop3.Disconnect
ZaksPop3参考说明
239查看:
对象的属性及方法:
所有代码段都必须调用该语句
setpop3=Server.CreateObject("
zakspop3.Server"
Property:
mailServerHost:
theIPAddressofthePOP3Server.
属性:
POP3服务器的IP地址
mailAccount:
TheusernameofthePOP3mailbox.
POP3邮箱的用户名
mailPassword:
Thepasswordofthemailbox.属性:
mailPassword:
邮箱的密码
mailPort:
defaultto110,thestandardportforthePOP3protocol
默认值为110,POP3协议的标准端口
errorString:
Anerrordescription,shouldanerroroccur.
错误发生后的错误描述
useUIDL:
settotruetoenableUIDLsupport(defaultstofalse).
值为真时,支持UIDL,默认值为假
Function:
Login:
Attempttoconnecttothemailserver&
mailbox,returntrueforsuccess,falseforerror
函数:
和邮件服务器及邮箱建立连接,连接成功返回True,出错时返回False
FetchHeaders:
Getthecurrentmessageheadersfromthemailserver
从邮件服务器读取邮件标头
Delete(msgID):
Deletesthespecifiedmessagefromthemailserver
从邮件服务器删除指定邮件
Collecti