How-to display a “Friendly Name” when using CDOSYS in a script.

This tip shows how to have a return address display with a friendly name instead of an email address. 


How to use in a VBS script


Dim imsg


Set iMsg = Createobject("cdo.message")


With iMsg


   .To = "John Monday <>"


   .From = "Steve Friday <>"


   .Subject = "A Subject Line: " & Now()


   .TextBody = "A Text body message"




End With


Set iMsg = nothing



Here is how to use in Classic ASP webpage.



Dim imsg
Dim strMessage

Set iMsg = Server.Createobject("cdo.message")


With iMsg


   .To = "John Monday <>"


   .From = "Steve Friday <>"


   .Subject = "A Subject Line: " & Now()


   .TextBody = "A Text body message"




End With


Set iMsg = nothing

strMessage = “Message sent:” & Now()






                        <% = strMessage %>



Reference links



Schedule a task to call a webpage using Task scheduler.

One frequent question I see in the newsgroups is "How do I schedule a task to run in IIS?”   This article discusses one technique using a VBS Script and Windows Task Scheduler.    Using Windows Task scheduler allows custom jobs to execute without having to stay logged into a server.    You can use this technique to request web pages frequently on a timed basis.  This keeps the page in-memory providing a better performance.   This could also request web pages to perform other administrative tasks. 

Here are steps to get started.

  • Write your VBS Script
  • Develop the webpage to process the HTTP Request
  • Create / Add table to database to track logging
  • Schedule the VBS Script

Write your VBS script

The script makes an HTTP request to a webpage on a timed basis.  (I.E. every 5 minutes).

Call LogEntry()

Sub LogEntry()

        ‘Force the script to finish on an error.
        On Error Resume Next

        'Declare variables
        Dim objRequest
        Dim URL

        Set objRequest = CreateObject("Microsoft.XMLHTTP")

        'Put together the URL link appending the Variables.
        URL = "

        'Open the HTTP request and pass the URL to the objRequest object "POST", URL , false

        'Send the HTML Request

        'Set the object to nothing
        Set objRequest = Nothing

End Sub
Track.aspx webpage

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="tracklog.aspx.vb" Inherits="Tracklog" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""&gt;

<html xmlns="; >

<head runat="server">
    <title>Log Page</title>


<form id="form1" runat="server">




Tracklog.aspx.vb code behind

Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration

Partial Class Tracklog

    Inherits System.Web.UI.Page

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

‘Put your code in that would process when Track.aspx is requested
       Response.write(“Track.aspx was called:” & System.DateTime.Now())

       End Sub

End Class

How to schedule a task using Windows Task Scheduler

A scheduled task will allow a person to schedule any script, program, or document to run.   Scheduled Tasks run at the time specified which could be multiple times per minute, hour, or day.  The KB Article explains step-by-step.


Refererence links

SMTPDiag – troubleshooting email issues

SMTPDiag is a handy tool for tracking down SMTP based issues.  I recently used in a newsgroup posting that was helpful along with a few other times at   It is definitely one of those tools worth having if you have to troubleshoot email issues. 

Bernard Cheah posting is helpful also.

Use Logparser to extract information from a remote server application event log.

I was recently extracting information from an application event log for a particular issue.  Using Logparser made it very simple to just get what I needed.  Hope this helps.

'Extracts information for '' and puts in a file called filename.csv

LogParser "SELECT SourceName,TimeGenerated,TimeWritten,Message INTO filename.csv FROM \ServerApplication where Message Like ''" -o:CSV

Installing Dotnetnuke 4.x on Windows 2003 w/SP1 domain controller – update

I wrote an article how to install Dotnetnuke 4.x on a Windows 2003 SP 1 domain controller.  Here is a "gotcha" I wanted to pass along thanks to Michael J. van Zwieten.   Thanks a bunch for passing this along.  I updated the article.  Here is Michaels comments.


I finally found an article that worked for me…

Specifically this part:

After many hours of looking for the problem I discovered that when you use the configuration editors for 2.x they add an attribute to the configuration element of the web.config file.

( xmlns="" )

I removed the Attribute and ran the website once again and much to my surprise the website compiled and ran all the installation scripts.


Here is the link to my original article.

Steve Schofield
Windows Server MVP – IIS
ASPInsider Member – MCP
Managed Complex Hosting
#1 in Service and Support