CDO for Exchange 2000:Messaging - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

CDO for Exchange 2000:Messaging

Description:

Content-Transfer-Encoding: quoted-printable. This is a multipart/alternative text & html message. ... Content-Transfer-Encoding: quoted-printable HTML ... – PowerPoint PPT presentation

Number of Views:57
Avg rating:3.0/5.0
Slides: 31
Provided by: jasonm55
Category:

less

Transcript and Presenter's Notes

Title: CDO for Exchange 2000:Messaging


1
CDO for Exchange 2000 Messaging Jason
MayansProgram ManagerExchange Server Product
UnitMicrosoft Corporation
2
(No Transcript)
3
CDO for Exchange 2000 Messaging Jason
MayansProgram ManagerExchange Server Product
UnitMicrosoft Corporation
4
Agenda
  • Introduction to MIME Messaging
  • Messaging features scenarios
  • Messaging Object Model
  • Objects
  • Interfaces
  • Code Samples

5
Intro to MIME Messaging
  • Internet Standard
  • Multiple content formats in mail
  • Extends RFC 822
  • Headers for encoding and identifying content
  • Content-Type
  • Content-Transfer-Encoding
  • Content-Disposition
  • Supported by Internet mail clients

6
MIME Messages
  • Divided into Body parts
  • Separated by a boundary tag
  • Body parts contain child body parts or data
  • Content-Type
  • Single part body parts
  • Multipart body parts

7
Sample MIME MessageText and HTML
From "Jason Mayans" ltjmayans_at_microsoft.comgtTo
"Bob" ltbob_at_samples.microsoft.comgtSubject Text
HTML MessageDate Sat, 4 Sep 1999 123248
0700MIME-Version 1.0Content-Type
multipart/alternative boundary"----_123" ------
_ 123Content-Type text/plain
charset"iso-8859-1Content-Transfer-Encoding
quoted-printable This is a multipart/alternative
text html message. ------_ 123Content-Type
text/html charset"iso-8859-1Content-Transfer-E
ncoding quoted-printable ltHTMLgtltBODY
bgColor3DffffffgtltFONT color3Dff0000
face3DArial size3D2gtThis is
a20multipart/alternative text amp html
message.lt/FONTgtlt/BODYgtlt/HTMLgt------_123--
8
CDO Messaging Scenarios
  • Server-based messaging development
  • Targeted mailers
  • Email notifications
  • Events Store and Transport
  • Discussion forums
  • Any application constructing MIME content

9
Messaging Objects
Message
IBodyPart IMessage IDataSource IRow
Addressee
IAddressee
BodyParts Collection
Configuration
IBodyParts
IConfiguration IRow
BodyPart
IBodyPart IRow
10
MessagingFlexible design
  • CDO lets you decide how much to abstract the
    underlying MIME data
  • Use IMessage and let CDO handle the MIME details
  • Use IBodyPart for more explicit control over the
    MIME hierarchy
  • Use Streams for complete control

IMessage
IBodyPart
Streams
11
IMessage InterfaceIntroduction
  • Supported by messaging objects
  • Shortcuts for complex MIME operations
  • AddAttachment, CreateMHTMLBody,
    AddRelatedBodyPart
  • Headers and other properties in ADO Fields
    collection
  • Exposes an ADO Stream for access to underlying
    data

12
IMessage InterfaceSending and posting messages
  • Messages can be sent via various transports
  • SMTP
  • Local and Remote
  • NNTP
  • Local and Remote
  • Exchange Outbox
  • Submit through OLE/DB directly to Outbox
  • Public Folder Posting

13
IMessage Interface Sending a simple message
Set Msg CreateObject(CDO.Message) Set
Msg.Configuration myConfig Msg.To
jeff_at_samples.microsoft.com Msg.Subject The
Meeting Msg.TextBody What time is the meeting
today? Msg.Send
14
IMessage Interface Mail a web page with
attachment
Set Msg CreateObject(CDO.Message) Set
Msg.Configuration myConfig Msg.To
jason_at_samples.microsoft.com Msg.Subject
Todays Top Stories Msg.CreateMHTMLBody
http//www.msnbc.com/news/311517.asp Msg.AddAtta
chment D\news.txt Msg.Send
15
IMessage Interface
Mail This Page To a Friend Button
16
IBodyPart InterfaceOverview
  • Handles MIME body parts
  • Supported by all MIME-based objects
  • ADO Stream access
  • Full stream, de/encoded
  • Collection for access to child body parts
  • ADO Fields collection provides access to headers,
    properties

17
IBodyPartExposing the MIME hierarchy
MIME MessageContent-Type multipart/mixed
Content-Type multipart/alternative
Content-Type text/plain
Content-Type text/html
Content-Type application/msword
18
IBodyPartLoading text
Content-Type multipart/alternative
Content-Type text/plain
Content-Type text/html
Set Msg CreateObject(CDO.Message) Set Bp
Msg.Bodypart Bp.ContentMediaType
multipart/alternative Set NewBp
Bp.Bodyparts.Add NewBp.ContentMediaType
text/plain Set Strm NewBp.GetDecodedContentStr
eam Strm.Type adTypeText Strm.Position
0 Strm.LoadFromFile D\plaintext.txt Strm.Flush
Set NewBp Bp.Bodyparts.Add NewBp.ContentMediaTy
pe text/html Set Strm NewBp.GetDecodedConten
tStream Strm.Type adTypeText Strm.Position
0 Strm.LoadFromFile D\htmltext.txt Strm.Flush
19
MIME Body Parts
  • MIME Viewer Demo

20
IDataSourceOverview
  • Provides access through CDO to data sources
  • Open data
  • Save data
  • Indicates dirty state
  • Allows you to manipulate content with the right
    object

21
IDataSourceAccessing mail from a folder
Set conn CreateObject(ADODB.Connection) Set
msg CreateObject(CDO.Message) Conn.provider
exoledb.datasource Conn.ConnectionString
file//./backofficestorage/mail.microsoft.com/pu
blic/discuss Conn.Open Set rs conn.execute
Select chr(34) DAVhref chr(34)
from scope(shallow traversal of
file//./backofficestorage/mail.microsoft.com/pub
lic/discuss) While not rs.EOF msg.DataSource.Op
en rs(DAVhref),conn msg.Attachments.DeleteAll
msg.DataSource.Save rs.MoveNext Wend
22
IDataSourceEmbedded messages
RFC 822 MessageContent-Type multipart/mixed
Content-Type text/plain
Content-Type message/rfc822
Sub AppendToEmbeddedSubject(Msg,Subject) Set
EmbdMsg CreateObject(CDO.Message) For
each bp in Msg.BodyPart.BodyParts If
Bp.ContentMediaType message/rfc822
then EmbdMsg.DataSource.Open bp,
IBodyPart EmbdMsg.Subject EmbdMsg.Subject
Subject EmbdMsg.DataSource.Save End
If Next End Sub
23
ConfigurationPurpose
  • Specifies user options
  • Display name
  • server configuration
  • Shared among CDO objects
  • Use in ASPs
  • One Configuration object per user
  • Should be application-scoped

24
ConfigurationUsing the configuration object
Set Msg CreateObject(CDO.Message) Set Config
CreateObject(CDO.Configuration) Config.Fields
(cdoSMTPUserEmailAddress) jeff_at_samples.micros
oft.com Config.Fields(cdoSendUsingMethod)
cdoSendUsingExchange Config.Fields.Update Set
Msg.Configuration Config
25
IAddressee Overview
  • Supported by the Addressee object
  • Supports name resolutionon a single name
  • Resolve without creating a message
  • Supports ambiguous name resolution
  • Get free/busy information

26
CDO and EventsTransport and Store
  • SMTP and NNTP Transport events
  • Events return CDO Messages
  • Exchange Store Events
  • Use CDO to manipulate content when messages are
    created, moved, deleted or saved
  • Sinks can be scripts, Visual Basic or Visual C
    DLLs

27
CDO Messaging
  • Demo

28
CDO Messaging Review
  • Exchange 2000 natively supports MIME content
  • CDO exposes MIME to the developer
  • Access to body parts, Streams, Fields
  • IDataSource for access to in-memory and stored
    data
  • ADO Integration
  • ADO Streams, Fields, Recordsets
  • ADO for folder navigation

29
Questions?
30
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com