Mail object


Properties

MailHeader Get email headers.
UIDL Get unique identifier of current email.
Size Get size of current email.
From Get sender information.
HeaderItems Get specified email header.
Subject Get subject.
Date Get email date in string format.
BodyText Get email body text.
To Get recipients collection.
CC Get carbon copy recipients collection.
AttachmentCollection Get attachment collection.
Flags Get/Set email flags.
Index Get index of current email in parent MailCollection object.
BodyFormat Get body format of current email.
Charset Get charset.
Chunk Get binary stream of current email.
Content Get encoded content of current email.

Remarks

Mail object contains all information of an email in specified mailbox.

Usage Example

Dim server, user, password, requestAddr
server = "localhost"
user = "hunter@emailarchitect.net"
password = "mypassword"
requestAddr = "192.168.0.1"

Dim oSvr
Set oSvr = CreateObject("EmailArchitectObjects.ServerRoot")
r = oSvr.Connect( server, user, password, 0, requestAddr )
If r <> 0 Then
  WScript.Echo( "connect server failed!" )
  WScript.Quit
End If

Dim oDomains, oDomain
Set oDomains = oSvr.DomainCollection
Set oDomain = oDomains.Items(CStr(oSvr.Domain)) 

Dim oUsers, oUser
Set oUsers = oDomain.UserCollection
Set oUser = oUsers.Items(CStr(oSvr.User))

Dim oMBXs, oMBX, oTools
Set oTools = CreateObject("EmailArchitectObjects.Tools")
Set oMBXs = oUser.MBXCollection

Set oMBX = oMBXs.Items(CStr(oTools.EncodeHex("inbox")))
Dim oMails, oMail
Set oMails = oMBX.MailCollection

'enumerate all mails in "Inbox" 
Dim i, nCount
nCount = oMails.Count
For i = 0 To nCount-1
  Set oMail = oMails.Items(CLng(i))
  WScript.Echo( oMail.Subject )
Next