You are currently offline, waiting for your internet to reconnect

How To Send HTML Formatted Mail Using CDO for Windows 2000 and the Local Pickup Directory

Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Summary
This article describes how to send HTML formatted mail through the local pickup directory using CDO for Windows 2000 (CDOSYS) or CDO for Exchange 2000 (CDOEX).
More information
  1. Create a file called Cdopickup.vbs and paste the following code:
    'Send using the Pickup directory on the IIS server.Dim iMsg Dim iConf Dim Flds Dim strHTMLConst cdoSendUsingPickup = 1set iMsg = CreateObject("CDO.Message")set iConf = CreateObject("CDO.Configuration")Set Flds = iConf.FieldsWith Flds     .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPickup    ' TODO: Replace <PICKUP DIRECTORY> with path to your pickup directory    ' Typically, c:\Inetpub\mailroot\pickup    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")="<PICKUP DIRECTORY>"    .UpdateEnd With' Build HTML for message body.strHTML = "<HTML>"strHTML = strHTML & "<HEAD>"strHTML = strHTML & "<BODY>"strHTML = strHTML & "<b> This is the test HTML message body</b></br>"strHTML = strHTML & "</BODY>"strHTML = strHTML & "</HTML>"Dim iBPWith iMsg   Set .Configuration = iConf   .To = "alias@domain.com"   .From = "youralias@yourdomain.com"   .Subject = "This is a test CDOSYS message (Sent via Pickup)"   .HTMLBody = strHTML   'TODO: if adding an attachment,   'uncomment the next line and alter file path as required   'Set iBP = iMsg.AddAttachment(App.Path & "\file1.txt")   .SendEnd With ' Clean up variables.Set iBP = NothingSet iMsg = NothingSet iConf = NothingSet Flds = NothingMsgBox "Mail Sent!"					
  2. Edit the sections of the code that are marked "ToDo".
  3. Save the file, and then double-click it.

    This script generates an HTML formatted message and sends it using the pickup directory.
References
For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
286431 How To Send HTML Formatted mail Using CDO for Windows 2000 and a Remote SMTP Service
Properties

Article ID: 286430 - Last Review: 06/19/2014 12:38:00 - Revision: 5.0

  • kbhowto KB286430
Feedback