[心缘地方]同学录
首页 | 功能说明 | 站长通知 | 最近更新 | 编码查看转换 | 代码下载 | 常见问题及讨论 | 《深入解析ASP核心技术》 | 王小鸭自动发工资条VBA版
登录系统:用户名: 密码: 如果要讨论问题,请先注册。

[本站胡乱翻译]AspEmail对象参考--中文说明

上一篇:[存档]CDO.Message(CDOSYS)接口列表-----Library CDO - COM interface listing
下一篇:[存档]CDO.Message参数设置一点小经验

添加日期:2006/3/24 15:12:48 快速返回   返回列表 阅读9366次
Persits.MailSender 属性 
======================================================================================
AltBody As String (Read/Write) 
Specifies an alternative text version of a message while Body specifies an HTML version. When this property is set, AspEmail generates a "multipart/alternative" message to support email clients that are not HTML-enabled. Side effect: when this property is set, IsHTML property gets set to True. This is a premium feature. 

Body As String (Read/Write) 
指定message主体,可以是文本或HTLML格式。如果是后者,属性IsHTML必须设置为True。
 
CharSet As String (Read/Write) 
默认为"ISO-8859-1"。
指定Content-Type MIME header部分的charset。
如果设置为非默认值,AspEmail会转换message主体信息的字符到指定的字符集。
如果设置为"UTF-8", AspEmail会使用UTF-8编码。 

ContentTransferEncoding As String (Read/Write) 
默认为"7bit"。
为message主体指定Content-Transfer-Encoding MIME header。
其他有效的值包括"8bit" 和"quoted-printable"。
如果设置为"quoted-printable",AspEmail 会自动转换message主体到Quoted-Printable(在RFC-2045里指定的) 格式。
如果设置CharSet为“UTF-8,此属性应该设置为"quoted-printable"。

Expires As Date (Read-Only) 
Returns the expiration date of the component's premium features. Returns 9/9/9999 if a valid registration key is installed. Returns 0 (displayed as "12:00 AM") if the expiration value in the registry is corrupt or missing. 

From As String (Read/Write) 
指定发送者的email,必须项目。

FromName As String (Read/Write) 
指定发送者的名字。

Helo As String (Read/Write) 
This string is sent with the HELO command (or EHLO if Username property is set) when an SMTP session begins. Used by an SMTP client to identify its domain name to the SMTP server. By default, AspEmail uses a value returned by the GetComputerNameEx Win32 API. 

Host As String (Read/Write) 
用来发信的SMTP主机的地址。
必须项目,除非使用消息队列,并且在EmailAgent控制面板中指定了主机。

IsHTML As Boolean (Read/Write) 
默认为False,如果Body是HTML格式的,此属性必须设置为True。 

MailFrom As String (Read/Write) 
指定回复的email地址。如果没有指定,将会使用From的值。 

Password As String (Read/Write) 
See comments to the property Username. This is a premium feature. 

Port As Integer (Read/Write) 
指定SMTP端口,默认为25。

Priority As Integer (Read/Write) 
指定消息优先级。有效的值为 1 (high), 3 (normal) 和 5 (low)。
默认为0,表示没有指定优先级。

Queue As Boolean (Read/Write) 
允许消息队列。
默认为False。
如果指定为True,则以后的Send的调用将会放置消息到队列中,EmailAgent将会处理它们。

QueueFileName As String (Read-Only) 
Returns the name of a message file generated by a call to Mail.Queue = True followed by Mail.Send. Do NOT use this property to specify a file attachments, use the AddAttachment method instead. 

Subject As String (Read/Write) 
指定消息标题。

Timeout As Integer (Read/Write) 
指定Socket超时时间,单位毫秒。

Timestamp As Date (Read/Write) 
用作消息的延期处理。
Specifies when the message is to be sent out from the queue by EmailAgent. This property is only used when Queue is set to True, and ignored when it is False. 

Username As String (Read/Write) 
SMTP认证的用户名。
AspEmail 支持 AUTH=LOGIN, CRAM-MD5 和NTLM 验证方式。

====================================================================================
Persits.MailSender Methods 

Sub AddAddress(Address As String, Optional Name = "") 
添加Email地址和对应的姓名(可选)到消息的收件人列表。
每个消息可以多次调用此方法。

Sub AddAttachment(Path As String) 
添加文件到附件列表。必须指定完整的物理路径。
每个消息可以多次调用此方法。

Sub AddAttachmentMem(Name As String, Blob As Variant) 
附加一个内存文件。Name指定文件名,Blob是内存二进制数组。
典型的第二个参数会是一个包含有文件Blob的RecordSet列,或表达式,如File.Binary。 

Sub AddBcc(Address As String, Optional Name = "") 
添加Email地址到暗送列表。每个消息可以多次调用此方法。

Sub AddCC(Address As String, Optional Name = "") 
添加Email地址和对应的姓名(可选)到抄送列表,
每个消息可以多次调用此方法。

Sub AddCustomHeader(Header As String) 
添加自定义Header。如:
mail.AddCustomHeader "Return-Receipt-To: <name@domain.com>" 

Sub AddEmbeddedImage(Path As String, ContentID As String) 
添加一个图像文件到消息的内嵌图像列表。
ContentID是一个无空格的字符串,如"My-Image", 可以在Body的HTML中这样引用:
 <IMG SRC="cid:My-Image"> 或 <BODY BACKGROUND="cid:My-Image">。

Sub AddEmbeddedImageMem(Name As String, ContentID As String, Blob As Variant) 
和AddEmbeddedImage相同,但是从内存添加一个图像,而不是硬盘。 

Sub AddReplyTo(Address As String, Optional Name) 
添加Email地址和对应的姓名(可选)到回复列表,
每个消息可以多次调用此方法。 

Sub AppendBodyFromFile(Path As String, Optional AddToBody = True) 
从路径指定的文本文件或HTML文件,追加Body内容(AddToBody参数设置为True或省略)。
如果AddToBody设置为False,文件的内容将被追加到AltBody。

Function EncodeHeader(Header As String, Optional Charset = "ISO-8859-1") As String 
依照RFC-1522,对包含non-US-ASCII字符的字符串进行编码,返回编码后的字符串。
使用此方法对non-US-ASCII标题,发送者名字或收件人名字。如

Mail.Subject = Mail.EncodeHeader("La fête à Jean-Sébastien Bach") 

Mail.AddAddress "oystein@somecompany.no", Mail.EncodeHeader("Øystein") 

Charset可以设置为"UTF-8"或其他任何有效的字符集。

Sub LogonUser(Domain As String, Username As String, Password As String, Optional Flags = 2) 
扮演指定的用户帐号。
如果Domain为空,本机将会用来验证次用户名和密码。
The caller must have the "Act as Part of the Operating System" privilege, otherwise the error "A required privilege is not held by client" error will be thrown. 
This method is useful when using message queuing (Mail.Queue = True) if the message queue is located on another machine and the current user account's credentials are insufficient to place a message in a remote queue. 

The Flags argument should not normally be used. 

Sub Reset() 
清除所有的地址和附件列表,以便一个新消息可以被发送。

Sub ResetAll() 
和Reset相同,另外,还reset所有的属性到各自的初始值。 

Sub RevertToSelf() 
结束由LogonUser开始的角色扮演。
 
Function Send(Optional Path = "") As Boolean 
发送消息。
如果成功返回True,否则返回False。
如果出错,则会抛出异常。
如果Mail.Queue设置为True,消息不会直接发送给SMTP服务器,而会放置到消息队列,以待EmailAgent进行处理。因此产生的消息文件的名字可以通过QueueFileName属性取得。
Path指定了消息队列的位置。如果忽略此参数,默认消息队列位置将被使用。
如果没有使用消息队列,此参数无视。

Sub SendEncrypted(Msg As CryptoMessage) 
发送加密的消息。Msg 是由AspEncrypt组件生成的对象

Sub SendSigned(Msg As CryptoMessage) 
发送数字签名消息。
Msg 是由AspEncrypt组件生成的对象

Sub SendSignedAndEncrypted(Msg1 As CryptoMessage, Msg2 As CryptoMessage) 
发送数字签名,然后加密的消息。

Sub SendToNewsgroup(Newsgroup As String) 
发送消息(文章)到一个NNTP协议指定新闻组。
此方法将无视AddAddress及其他方法指定的地址。
Host必须指向一个有效的NNTP服务器。默认使用端口119。

Sub SendToQueue(Optional Path = "") 
等价于Mail.Queue = True 后调用Mail.Send。
被废止,仅用来向后兼容。

Function ValidateAddress((Address As String) As Integer (Version 5.0.0.4) 
对指定的email地址进行构文验证,确保构文有效。
此方法不能确认一个email地址是否存在。
返回以下值:
0 - 有效地址
1 - 太短
2 - 太长(超过256字符)
3 - 没有字符@
4 - @之前没有任何东西
5 - @之气的字符必须是a-z A-Z 0-9 ' _ . -
6 - @后没有.
7 - 子域名长度为0
8 - 子域名的字符必须是a-z A-Z 0-9 -
9 - 最高层的子域名必须是a-z A-Z 0-9
10 - 最高层的子域名至少应该有2个字符。
11 - Name part of address cannot start or end with a dot 
====================================================================
Persits.MailLogger 属性 

Records As Object (Read-Only) 
返回LogEntry对象的集合。

Persits.MailLogger Methods 

Sub Clear() 
清除Log文件,所有Log中的记录被清除。
Sub Close() 
关闭由Open方法打开的Log。
Sub Open(Optional Path = "") 
打开Log,组装Records集合。如果指定了Path,则打开指定路径的文件。

Sub Refresh(Optional Path = "") 
用最近的数据重新组装Records集合。
================================================================================
LogEntry 属性 

DateTime As Date (Read-Only) 
返回LogEntry 的时间戳信息。

FileName As String (Read-Only) 
返回LogEntry所依赖的消息文件的文件名。

Recipient As String (Read-Only) 
返回收件人。

Status As String (Read-Only) 
返回以下字符串:
"SUCCESS" - 成功的SMTP发送
"FAILURE" - 非致命错误的发送,消息将被重新发送。
"ERROR" - 致命错误的发送,消息被移动到\Failed 文件加,并且不会被重发。
"SYSTEM" - 系统错误。如连接POP3服务器失败等等。
"RECEIVED" - 成功从POP3取回消息

Text As String (Read-Only) 
返回整个log entry。

 

评论 COMMENTS
没有评论 No Comments.

添加评论 Add new comment.
昵称 Name:
评论内容 Comment:
验证码(不区分大小写)
Validation Code:
(not case sensitive)
看不清?点这里换一张!(Change it here!)
 
评论由管理员查看后才能显示。the comment will be showed after it is checked by admin.
CopyRight © 心缘地方 2005-2999. All Rights Reserved