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)’   http://msdn.microsoft.com/library/en-us/cdo/html/_denali_newmail_object_cdonts_library_.asp?frame=true     Dim objMail ‘As CDONTS.NewMail    Set objMail = CreateObject(“CDONTS.Newmail”)    objMail.BodyFormat…


How to use PS_INTERNET_HEADERS with cdo 1.21 for custom properties.

‘This example uses PS_INTERNET_HEADERS for setting a custom property const smbx=”mymailbox”  ‘ TODO: Changeconst ssrv=”myserver”      ‘ TODO: Changeconst mycdoInetPset = “8603020000000000C000000000000046″const myXheader = “X-SPAM”  ‘ TODO: Change to your property set oses=createobject(“mapi.session”)oses.logon “”, “”, false, true, 0, true, ssrv & vblf & smbxset omsg=oses.inbox.messages.getfirstsfrom=omsg.fields.item(myXheader,myCdoInetPset).valuewscript.echo sfromomsg.fields.add myXheader, vbString, “I Hate Spam!”, myCdoInetPsetomsg.update set omsg=nothingset oses=nothing


Howto: Get Free/Busy information using CDO 1.21 and vbs

Below is a sample:   ‘———————————————————–‘ getfbCDO121.vbs – Get Free/Busy information using CDO1.21 and vbs’ Instructions:’   Save to a file called getfbCDO121.vbs ‘   Do the TODO: sections’   Run from the command line using:  cscript getfbCDO121.vbs ‘————————————————————    Dim ObjSession      ‘MAPI.Session    Dim ObjMessage      ‘MAPI.Message    Dim ObjAddressEntry ‘MAPI.AddressEntry    Dim sFreeBusy    Dim sFBFrom    Dim sFBTo    Dim sLoginProfileInfo ‘ This…


How to read the Inbox messages and delete attachments over a given size using VB and CDO 1.21

Below is a sample:  Here is an example:     ‘ 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 As String    Dim objSession As MAPI.Session    Dim objAttach As MAPI.Attachment    Dim strExServer As String    Dim…


HOWTO: VB6/CDO 1.21 – expand a distribution list

Below is a sample:   ‘ TODO: Create a new VB Project’ TODO: Set a reference to CDO 1.21′ TODO: Add a button to the form and paste this code in.’ TODO: Change TODO: sections below. Private Sub Command1_Click()     Dim objSession As MAPI.Session    Dim ObjMessage As MAPI.Message    Dim objUseRecips As MAPI.Recipients    Dim objRecips As…

2

How to read free/busy information using CDOEX and VBS?

Below is a .VBS sample… please note that this needs to run from the Exchange server. ‘———————————————————————————————————‘ getfb.vbs – Get Free/Busy information using CDOEX and VBS’ This code must run from Exchange Server’ Instructions:’   Save to a file called getfb.vbs’   Do the TODO: sections’   Run from the command line using:  cscript getfb.vbs’———————————————————————————————————Dim strUserToCheckDim iAddr    Dim…


Looking for a way to save a .msg file or load a .msg file?

Outlook Object Model (OOM) can do this easily.  Below is a sample:   howto – save and load a message to a folder.Sub SaveAndLoadMsgFile()   Dim ol As Outlook.Application   Dim olns As Outlook.NameSpace   Dim oOrigItem As Outlook.MailItem   Dim oNewItem As Outlook.MailItem   Set ol = CreateObject(“Outlook.Application”)   Set olns = ol.Session   Set oOrigItem = olns.GetDefaultFolder(olFolderInbox).Items(1)   oOrigItem.SaveAs “C:\test.msg”, olMSG  …

2

Using ISAPI Extensions to change-out OWA Credential is not supported

Single sign-on applications usually use an ISAPI Extension on Exchange servers in order to swap-out credentials being passed to OWA.  This type of manipulation is not supported by Microsoft.  In fact any thing which augments the behavior in this way is not supported.  While such filters/extensions may have worked with Exchange 2000 and 2003, they…

4

Why can’t I do a deep traversal search wtih WebDAV???

  Why can’t I do a deep traversal search wtih WebDAV???   Ok, first review the following article… Specifying a Deep Traversal <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_exch2k_specifying_a_deep_traversal.asp> Deep traversals are not supported in MAPI stores, such as the client public store installed by Microsoft Exchange 2000 Server, but are supported in private stores and in any new public folder…


How to add a holiday to a calendar using VB and CDO 1.21.

‘ How to add a holiday to a calendar using VB and CDO 1.21.” This example code shows how to add a holiday to a calendar using VB and CDO 1.21.’ Set a reference to CDO 1.21 and do the TODO sections in the code. ‘ Holidays are All Day Appointments with the Category of…

9