asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search





Active News
15 Seconds Weekly Newsletter
• Complete Coverage
• Site Updates
• Upcoming Features

More Free Newsletters
Reference
News
Articles
Archive
Writers
Code Samples
Components
Tools
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

HardwareCentral
Compare products, prices, and stores at Hardware Central!

You've Got Mail! - Site Server Direct Mailer
By Shiva Manjunath
Rating: 4.5 out of 5
Rate this article


  • email this article to a colleague
  • suggest an article

    Introduction


    Microsoft Site Server 3.0 comes with a bulk-mailing tool called Direct Mailer. Once properly configured, this tool can be used in conjunction with the SMTP server, the Membership Server, and the Message Builder Service to send personalized emails to the members in your site-server membership directory. A real-life scenario would be, for example, if you have an online clothing or toy store, you could use Direct Mailer to send promotional mails with printable discount coupons or mails informing the members of upcoming Sales.

    In this article, I'll walk you through the steps necessary to configure the Direct Mailer tool properly and send a personalized email to target members.

    Article Map

    This article is split into the following steps:

    • Required Services and Components
    • Creating/Configuring the Membership Server Instance
    • Changing the Membership Directory Accounts User Passwords
    • Direct Mailer's Default Properties
    • Creating the Test Environment
    • Adding the Test Members to the Test Distribution List
    • Mapping the Default Web Site to the Membership Directory
    • Getting Started with the Direct Mailer Tool
    • Creating the Template Mail
    • Creating a Direct-Mailing Package
    • Executing the Mail Package
    • You've Got Mail!
    • Performance and Scalability
    • Related Microsoft Knowledge Base Articles

    Required Services and Components

    For proper functioning of the Direct Mailer tool, the following components are required either on the same server or on a remote server depending on the overall logical layout of your e-commerce site.

    SMTP Server - Used by the Message Builder Service to send out the emails.
    Site Server Message Builder Service - The backbone of the Direct Mailer tool that composes the messages and sends them out through the SMTP server.
    Site Server List Builder Service - Sends queries to Site Server Analysis for mailing lists.
    Windows Scheduler Service - Required only if you want to schedule mail delivery at periodic intervals.
    Site Server Analysis - Used for personalizing mails and selecting target email recipients based on their page visits and user profiles. This component will come into the picture only if you use the "from Analysis" option while creating the mailer package.

    Creating/Configuring the Membership Server Instance

    When you create the Site Server Membership Server Instance for your e-commerce Web site and plan to use the Direct Mailer tool, you would have to include the Message Builder Service. When setting up a new membership server, select the Message Builder Service in the Select Configuration Options of the New Membership Server Wizard as shown in Figure 1.


    Figure 1: Select Configuration Options

    The Message Builder Service does the job of composing the e-mail from the template file, and sending it out to the recipients using the SMTP Server. It also uses the LDAP service to access the membership directory of Site Server.

    After you check the Message Builder Service in Select Configuration Options and get past a couple of other screens, you will be prompted with the Message Builder Configuration screen (see Figure 2).


    Figure 2: Message Builder Configuration

    This is where you enter the name of the SMTP server that the Message Builder Service will use to push out the emails. If you are expecting a high volume of email traffic, then for performance considerations, it is advisable to have the SMTP Server on a separate machine.

    Once you set the SMTP server name and choose Next, the Wizard will display the configuration details, including the two membership directory accounts and one NT account that will be created for this Membership Server Instance (see Figure 3).


    Figure 3: Complete the configuration.

    The two membership directory accounts will be of the format MBSDM?_servername, MBSBRK?_servername) where ? is a number and servername is your server machine name. In my case (refer to Figure 3) , the user accounts are MBSDM4_EUGENE and MBSBRK4_EUGENE, respectively, and the servername is EUGENE. Also note that the SMTP server is residing in the same machine as my Internet Information Server (IIS) and Site Server Membership Server, in my case. The MBSDM?_servername user is created for the Message Builder Service Direct Mailer and MBSBRK?_servername is the user created for the Message Builder Service Broker.

    The impersonation user account in the NT User List (memproxyuser?) will be used by the Message Builder Service to run services as an NT User. (? is a number). In my case the user account created is MemProxyUser4.

    Changing the Membership Directory Accounts User Passwords

    The two membership directory accounts created by the New Membership Server Instance Wizard will have a default password set. You will need to change the password for the MBSDM?_servername, because you will require the password to configure the Direct Mailer tool (see the latter topic on Direct Mailer's Default Properties).

    To change the password, open up the Site Server Admin Microsoft Management Console (MMC) and expand the Members node in the Membership Directory Manager. You will see the two accounts in the right pane (see Figure 4).


    Figure 4: The Members node in Membership Directory Manager.

    Double click each user to view the Properties window for that user. Enter the new password in value box for the user-password attribute and choose OK to save the new password. See Figure 5.


    Figure 5: Enter new password in the user-password attribute.

    Direct Mailer's Default Properties

    To view/modify the Direct Mailer settings, open up the Site Server MMC and expand the Personalization and Membership | servername | Membership Server instance name Node. Right click on Direct Mail and choose Properties to bring up the property pages. See Figure 6.


    Figure 6: Entering password in Direct Mail Properties.

    Notice that the username specified in the Membership Directory Connection section of the General tab is the user that will be used to connect and retrieve the distribution list and member attributes when the Direct Mailer is run. If you have changed the password for this user (MBSDM?_servername user) as described in the previous section, then you need to enter the same password In the General tab. After entering the new password, you can verify it by clicking the Check password button.

    The Logging tab of the Direct Mail properties window is used to configure the frequency of logging, as well as the storage location of the log files (see Figure 7).


    Figure 7: Configure the frequency of logging.

    The two log files that will have filenames msgbldsvcdatetime.log (e.g., msgbldsvc20010123100016.log is the log file generated on Jan 23, 2001) and msgbldsvc.iwl.

    The log file msgbldsvcdatetime.log will contain the actual logs, including site URLs, IP address of the visitor, etc. The msgbldsvc.iwl log file will contain the log of activities of the Message Builder Service.

    After the first run on the Direct Mailer, you can open both these files using any text editor and view the entries to better understand the logging.

    Creating the Test Environment

    You will need to create the test environment only for the first time that you are configuring Direct Mailer on your Site Server. It is a good idea to test the Direct Mailer with some test email address within your intranet so that correct delivery and content of the emails can be checked.

    There are two steps to this.

    Creating the Test Members: Open the Site Server MMC, and create a few test members under your Membership Directory Manager. The important attributes that you need to add for these test members are their email addresses, and their first and last names. These three attributes are sufficient for testing the Direct Mailer and the personalization of the email. See Figure 8.


    Figure 8: The email address and first and last names are the three attributes needed for test members used to test Direct Mailer.

    Creating the Test Distribution List: The Direct Mailer works off a distribution list. So in order to test it, we have to create a test Distribution List and add the aforementioned test members to that list.

    In the Membership Directory Manager, right click and choose New | Object. After you get past the splash screen, In the Select the Class of Object to create window, choose distributionList and click Next ( see Figure 9).


    Figure 9: Creating a distribution list.

    Enter a name for the distribution list in the New Object screen (see Figure 10).


    Figure 10: Enter the name of your distribution list.

    Click Next. You'll come to the Add Attributes for Object screen. There will be an email address attribute already in the attributes table (see Figure 11).


    Figure 11: Next the existing Email Address attribute type in a valid test email address as a value.

    Enter a valid test email address as a value. Note that later, when you use the Direct Mailer tool, this is the email address that you'll specify to tell the Direct Mailer which distribution list to use.

    Adding the Test Members to the Test Distribution List

    Double click the newly created distribution list and choose the Members tab and click Add. From the Available Items list, click the members that you created earlier and click Add to add them to the list.

    Mapping the Default Web Site to the Membership Directory

    In order to use Direct Mailer, the default Web site in your IIS has to be mapped to the Membership S containing the members and the distribution list. This is required. It is the only way the Message Builder Service can identify which Membership Server to connect to and then use to look for the distribution list and member attributes.

    In the Site Server MMC, expand the Internet Information Server | servername. Right click the Default Web Site node and choose All Tasks | Membership Server Mapping. This will display the Membership Server Mapping dialog (see Figure 12).


    Figure 12: Select the appropriate Membership Server to map your IIS to the server.

    Choose the appropriate Membership Server and click OK to set it.

    Getting Started with the Direct Mailer Tool

    Open the Direct Mailer by choosing Start | Programs | Microsoft Site Server | Tools | Direct Mailer. You will be prompted to set the settings.

    If you are not prompted, choose Tools | Setting from the Direct Mailer menu to bring up the Direct Mailer Setting Property pages.

    Choose the Defaults tab. In the sender's name, enter the email address that will be sent to each mail recipient as the sender's email address. If you want to receive replies to the emails, which is very unlikely if you are sending out promotional mails, then enter a valid email address here. Otherwise you can enter any invalid address, like promotions-dontreply@eugene.com or something similar.

    If you want to receive a status message informing you of the progress of the Direct Mailer package that you create and run then, enter a valid email address under Status recipient. See Figure 13.


    Figure 13: Entering a valid sender's name is optional. Add an email address under "Status recipient" if you want a message informing you of the Direct Mailer package's progress.

    The Analysis Integration tab (see Figure 14) will be required only if you are using the Analysis database data to generate the email recipients dynamically. Here you can specify the server and database details for Direct Mailer to access the Analysis database.


    Figure 14: If using Analysis database to generate email recipients dynamically, specify server and database details here.

    In this article, I will cover only basic personalized emails based on a distribution list. Using the Analysis data with Direct Mailer is a subject, which, in itself requires a detailed discussion, which is beyond the scope of this article.

    Creating the Template Mail

    The next step is to create the mail that will be used as a template for the Direct Mailer's bulk-mail package. After testing this template mail ASP file, you can store it in a separate directory, say templates under your Web server's virtual directory.

    This way, for subsequent direct mailings to your members, all you have to do it replace this template ASP file with the new one that you want to send out as email and simply run the Direct Mailer package.

    For our test, let's create a simple ASP file called dmMail.asp with the following code in it.

    <HTML>
    <head>
    <TITLE> Promotions from TAToyz </TITLE>
    </head>
    <BODY>
    <%
    on error resume next
    set oAUOUser = Server.CreateObject("Membership.UserObjects.1")
    
    If err.number <> 0 then
        response.write Err.description
        response.end
    end if
    %>
    
    <H3> Dear <% response.write oAUOUser.givenname & " " & oAUOUser.sn %> </H3>
    <P>
    TAToyz is having a grand sale of all toys for Memorial Day weekend.
    Hurry now. To buy toys online visit <A href="http://www.TAtoyzRus.com"> TAToyz</A>
    </P>
    </BODY>
    </HTML>
    
    Observe the personalization of this mail in the line <H3> Dear <% response.write oAUOUser.givenname & " " & oAUOUser.sn %> </H3>

    When the Message Builder Service processes this template ASP file, it will go through each member in the distribution list and retrieve the member's attributes that are referred to in the ASP file. It will replace the attributes with actual values before pushing the file as mail to the recipient through the SMTP server.

    In our case, marydoe@eugene.com will receive an email that will say

    Dear Mary Doe,
    
    TAToyz is having a grand sale of all toys for Memorial Day weekend.
    Hurry now. To buy toys online, visit TAToyz.
    
    After creating the template ASP file, we have to set minimum file permissions so that the Message Builder Service can read it. Right click the file in your IIS console's virtual directory where it resides, choose Properties and click the Security tab. Ensure that everyone has at least read access to it.

    Another important issue is that this template ASP file must also use automatic cookie authentication. The Message Builder Service requires this in order to impersonate each user, while creating the personalized email from the template file.

    To set the authentication mode, expand the Internet Information Server node and choose servername | Default Web Site | yourvirtualdirectory | templates Right click the dmMail.asp file in the right pane and choose Properties. Click the Authentication tab and choose Automatic Cookie authentication in the Security Service Providers tab. Click OK.

    Creating a Direct-Mailing Package

    Finally! Direct Mailer is now fully configured to help us create a mailing package and run the package to send out the bulk mail.

    From the Direct Mailer menu, choose Schedule | Create Direct Mailing ...

    The Create New Direct Mailing wizard will display the Direct Mail Name and Template dialog. Under Name, enter the name of the package, say TA Weekly Newsletter. In the Template field, enter the path to the dmMail.asp file. Choose the Personalize the message for each recipient option, as we want each member to receive the mail according to his/her membership attributes. See Figure 15.


    Figure 15: Establish these parameters to select the email template and to make sure each member receives the mail according to his/her membership attributes.

    Click Next. You will see the Select Users dialog. We will be using the first option, which is Use existing distribution list. Enter the email address of the distribution list that you created earlier. Note that we are using the email address attribute's value here and not the distribution list name. This is how Direct Mailer expects it.


    Figure 16: Enter the email address attribute's value and not the distribution list name.

    Choose Next. The Sender Name and Schedule dialog will appear. For the sender name, enter any email ID. It need not be a valid one. This is the email that the recipients will see. Enter a subject for the mail. To schedule this task, click Change and schedule it. See Figure 17.


    Figure 17: Enter a sender's name and schedule your direct mailing.

    Choosing Change will show you the Windows scheduler. If this is a recurring mailing, for example, a weekly newsletter, then you can schedule it here. The various options in here are pretty self-explanatory. See Figure 18.


    Figure 18: This is the dialog used to schedule mailings.

    Executing the Mail Package

    In the previous step, if you had chosen Finish, the Direct Mailer package would have started executing immediately. If you scheduled it by choosing Change, you could run it now by choosing Schedule | Edit Schedule from the Direct Mailer menu. Doing so will take you to the Scheduled Tasks folder. You can run the Direct Mailer package by right clicking the name of the scheduled Direct Mailer package and choosing Run.

    The status of the mailing will be displayed in Direct Mailer's main window. You can observe the progress of the package in the Status column. Once complete, the task name will disappear. However, if any errors are encountered, that will be displayed under Status and the same can be viewed. See Figure 19.


    Figure 19: Direct Mailer's main window provides status information and notifies you of any errors.

    You can also view details about the mailer's activities by viewing the two log files that Direct Mailer creates in the WINNT\system32\LogFiles\Direct Mail Logs directory: Viz msgbldsvc.iwl and msgbldsvcyyyymmddhhmmss.log. (Note that yyyymmddhhmmss = yearmonthdayhoursminsec.)

    You've Got Mail!

    After the Direct Mailer package has executed successfully, use any mail client to access the mailbox of one or more of the test users. You should have received a personalized email based on the template file you specified earlier. You are now ready to start sending out direct mailing to the members.

    Performance and Scalability

    The Direct Mailer Capacity and Performance Analysis document provided by Microsoft can be obtained from http://www.microsoft.com/mcis/reskit/docs/rk_DirMailCPA.doc. This document discusses in detail the performance and scalability of Site Server 3.0 Direct Mailer. (Since this document is stored as part of a resource kit, it does not show up if you search for it in MSDN or the knowledge base. I had a hard time trying to locate it in the knowledge base. Ultimately I was able to salvage the link from a posting in a discussion board.)

    Related Microsoft Knowledge Base Articles

    When I first started using the Direct Mailer in 2000, I had trouble configuring it due to limited documentation at that time. The documentation now is much better and detailed. There are a series of support and Microsoft Knowledge Base articles that will help you troubleshoot problems.

  • Q229972 : Direct Mailer User Password Is Saved to Text File on Public Share.
  • Q241382 : Direct Mail User Connection Password Check Fails.
  • Q216230 : Site Server Message Builder Service Error: A Connection with the Server Could Not Be Established.
  • Q216245 : Direct Mailer Cannot Process Configured Template.
  • Q240182 : Direct Mailer Sends Message to Incorrect Recipient.

    Visit http://search.support.microsoft.com/kb and enter the article ID e.g., Q229972) to reach the corresponding article.

    Acknowledgement

    For providing valuable direction and encouragement.

  • Vitaly Feldman ( Technical Architect, netNumina, Inc.)
  • Syed Zakir Ali ( Senior Consultant, netNumina, Inc.)

    For giving me the flexibility to write and work on projects simultaneously, Ross McLellan.

    About the Author

    Shiva Manjunath has been designing, developing, and implementing applications using Microsoft technologies since 1996. He currently works for this cool company called netNumina, Inc., in Cambridge, Mass., with a team of highly techie and fun to work with financial service strategists, Internet architects, visual designers and developers. More information can be obtained from http://www.netnumina.com.

    Shiva is a Microsoft Certified Professional and holds a Bachelor's Degree in civil engineering. In his spare time, he finds joy in annihilating his colleagues at the Ping-Pong table and in helping his neighbors keep their pet cats and dogs under control. Shiva can be reached at nyshiva@hotmail.com.

  • Rate This Article
    Not HelpfulMost Helpful
    1 2 3 4 5
    Supporting Products/Tools
    Bulk membership import/export tool
    This is a utility that is used for bulk membership import/export. Other than the command line help, I have no documentation.

    I make no warranties that it works. It is unsupported. Be sure to have a backup before you run this program. Use at your own risk.

    [Top]
    Other Articles
    Nov 19, 1998 - Credit Card Validation with Site Server Commerce
    This article written by Dina Berry explains how to add simple credit card validation to a pipeline in your Commerce site. The article shows you how to create the pipeline, how to add the pipeline to your ASP code and how to debug the pipeline.
    [Read This Article]  [Top]
    Mailing List
    Want to receive email when the next article is published? Just Click Here to sign up.

    Support the Active Server Industry

    internet.commediabistro.comJusttechjobs.comGraphics.com

    Search:

    WebMediaBrands Corporate Info

    Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
    Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs