Exchange Mail Submission URI
Topic Last Modified: 2006-06-12
Microsoft® Exchange Server 2007 provides a new process for sending messages using the WebDAV protocol and the Exchange OLE DB (ExOLEDB) provider. You can send messages using a special Uniform Resource Identifier (URI) called the Exchange mail submission URI. A user's mail submission URI is found by retrieving the value of the urn:schemas:httpmail:sendmsg property of the user's private mailbox folder. To send messages using the URI, the sending agent must have the user's credentials or Send On Behalf Of rights for that mailbox.
To send a message, you have the following two options:
Write a RFC 821 stream to the item's stream. With HTTP, you do this with the PUT protocol command. With the ExOLEDB provider, you retrieve the item's default stream (adDefaultStream in Microsoft ActiveX® Data Objects (ADO)) and write the message stream to it. The portion of the stream containing the message must be in the format defined by RFC 822 and the Multipurpose Internet Mail Extensions (MIME) specification. The entire stream must contain the RFC 821 SMTP protocol commands listed at the beginning, as shown in the following example:
MAIL FROM:: "User 1" <user1@fake.example.com> RCPT TO: "User 2" <user2@fake.example.com> RCPT TO: "User 3" <user3@fake.example.com> (Message Stream)
The SMTP DATA protocol command is not needed and is assumed after the first blank line designated by the first "\r\n\r\n" sequence in the stream.
When sending a message over HTTP, the sender must be authenticated as either the owner of the mailbox or a user with Send On Behalf Of rights for this mailbox.Write the properties for the message defined for the urn:content-classes:message content class. This is similar to sending messages using MAPI the Exchange store automatically generates the message stream for you when you commit the properties to the item. When sending a message using the ExOLEDB provider, the sender must be authenticated as either the owner of the mailbox or a user with Send On Behalf Of rights for this mailbox. When using this process, you cannot add attachments or send a complex MIME-formatted message.
Unlike the user's outbox folder, the mail submission URI is neither a folder nor an item in the user's mailbox. It is a virtual item used only to send messages by using the HTTP protocol or the ExOLEDB provider.