title: Delete line after reading from text file
body: <p>How do I get this script to delete each line of text after reading it instead of just going onto the next one and still leaving it in the text file.</p>
  
  <p>What can I do to change it?</p>
  
  <pre><code>Dim fso  
  Set objEmail = CreateObject("CDO.Message")
  objEmail.From = """UPS"" &lt;User@Example.com&gt;"
  objEmail.Subject = "This is a test"
  
  Const ForReading=1
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set dict = CreateObject("Scripting.Dictionary")
  BodyText = fso.OpenTextFile("C:\Users\User\Desktop\UPS-Email.htm",ForReading).ReadAll
  objEmail.HtmlBody = BodyText
  
  'objEmail.AddAttachment "C:\Users\User\Desktop\test.txt"
  
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set dict = CreateObject("Scripting.Dictionary")
  Set file = fso.OpenTextFile ("C:\Users\User\Desktop\e.txt", 1)
  row = 0
  Do Until file.AtEndOfStream
      line = file.Readline
      dict.Add row, line
      row = row + 1
      objEmail.To = line
  
      objEmail.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
      objEmail.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
      objEmail.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
      objEmail.Configuration.Fields.Update
      objEmail.Send
  Loop
  </code></pre>