Inline attachments used with EWS and Text, HTML, MHTML or MIME

Exchange Web Services has three different ways to set message body content when working with messages – setting the Text body, setting the html body or creating the message using email MIME (note that there are different types of MIME).  Images which are directly with HTML content are not supported.  HMTLM is an archival format…


Sample: How to get the number of file attachments with EWS.

Since HasAttachments does not really give you the number of file attachments, we you will find that you need to work around it.  You can use code like that below to get the real count of file attachments on an item.       // —————————————————————————————–     // GetFileAttachmentsCount     //   Returns number of attachments on…


Adding Inline Attachments with CDOSYS and System.Net.Mail.

In the following samples, I’m going to send an inline attachment using CDOSYS and System.Net.Mail (SNM). Lets say you have an html document with text above and below a jpg file and you want this document inside of a message you are going to send.  Below is the the basic HTML document.   Notice that img…


Howto Delete Attachments with WebDAV

The DELETE verb only works on Exchange 2003 SP1 – it will not work on any earlier version/service pack.  CDOEX, CDO 1.21, Extended MAPI, etc can do this on Exchange 2000 or 2003.    One possible work-around is to read the message stream using a WebDAV GET, modify the stream to remove the attachment and…


HOWTO: Send Email With Attachment Using VB and WebDAV

To send an email with WebDAV, you will you will need to create/recreate the item with a WEBDAV PUT using the MIME of the message.  It gets tricky when working with attachments.  To get around the complexity of sending an email with an attachment, you may want to look at using CDOSYS to build the…


Howto: WebDAV SEARCH using C#

‘ This example shows how to do a SEARCH using C# // C# Example to SEARCH a mailbox.// TODO://   Add a button and double click on it//   Add a multi-line text box and make it big.//   Add a project reference to System.Xml, an System.Net//   Paste-in the code below//   Do the TODO sections in the code….



‘ This example shows how to do a PROPFIND using VB.NET ‘ VB.NET PROPFIND‘ TODO: Create a VB.NET winform with a button and a big multiline text box‘ TODO: Add references to System.Web, System.XML and System.IO‘ TODO: Add the code to the form.‘ TODO: Do the TODO sections in the code. Imports System.NetImports System.WebImports System.IO…


Howto: WebDAV X-MS-ENUMATTS using VBScript to enumerate attachments

‘ This example shows how to enumerate attachments on a message.  X-MS-ENUMATTS will ‘ return phantom urls to attachments on the message.  These URLs can be used with GET ‘ and DELETE (starting with Exchange 2003 SP1).  ‘ For listing and reading an attachment, you will first need to get a list of attachments ‘…


HOWTO: VB/CDO 1.21 – Delete inbox message attachments over certain size

  Here is an example:    ‘How to read the Inbox messages and delete attachments over a given size using VB and CDO 1.21     ‘ This example deletes all jpg file attachments over a certain size in an inbox.        Const CONST_MAX_JPG_ATTACHMENT = 3000   ‘ TODO: Change this – max jpg file size    Dim sErrorMessage…


HOWTO: CDONTS/VBS Send an Email with an attachment

Here is a sample for sending mail using CDONTS… Please note that CDONTS is not supported on Windows 2003 and later: ‘ HOWTO: CDONTS/VBS Send and Eamil with an attatchment” For more information on sending an email using CDONTS see:’    NewMail Object (CDONTS Library)’     Dim objMail ‘As CDONTS.NewMail    Set objMail = CreateObject(“CDONTS.Newmail”)    objMail.BodyFormat…