Results 1 to 2 of 2

Thread: read the email addresses from a text file

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    7

    read the email addresses from a text file

    Can anyone help ?

    I have designed a form to send marketing emails its at
    http://www.allefinance.com/cbsmarketingemail.asp

    you can alter your content, email addresses, subject line as you wish
    this isn't actually in vbscript yet by the way.

    My boss wants to read the email addresses straight from a text file instead of us having to cut and paste a chunck load of email addresses with commas between them in the email address box.

    Does anyone know how to do this using CDO vbscript ?

    Shirley
    Shirley

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    This will create the FileSystemObject in FF. Then you can open textstreams and read 'em in through there.

    I will elaborate.

    Code:
    <%
    Dim FF
    Dim myFile
    
    Set FF = System.CreateObject("Scripting.FileSystemObject")
    Set myFile = FF.GetFile("addresses.txt")
    
    Dim oTStream
    Dim TheLine
    Dim FirstLine
    
    Dim Addresses
    Set oTStream = myFile.OpenAsTextStream(1,-2)
    
    Do While oTStream.AtEndOfStream <> True
       FirstLine = FirstLine + 1
       If FirstLine = 1 Then
          TheLine = oTStream.ReadLine
       Else
          TheLine = TheLine + "," + oTStream.ReadLine
       End If   
    Loop
    oTStream.Close
    %>
    
    ...
    ...
    ...
    <INPUT TYPE="text" VALUE="<% =TheLine %>">
    ...
    ...
    ...
    Just make sure addresses.txt looks something like this:
    Last edited by Sastraxi; May 16th, 2001 at 03:03 PM.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width