ASP Page emailing text file

Discussion in 'ASP General' started by Porky, Dec 1, 2003.

  1. Porky

    Porky Guest

    I have an asp page that successfully writes out the form data to a text
    file. I would like to use Blat (or other free email utility) to send
    the contents of the text file to a user. The code to email is as
    follows:

    Dim stdout, shell, cmd
    function ExecCmd(cmdline)
    set stdout = wscript.stdout
    set shell = createobject("wscript.shell")
    set cmd = shell.Exec(cmdline)
    do until cmd.status=1: wscript.sleep 5:loop
    ExecCmd = cmd.stdout.readall
    End Function

    ExecCmd("blat .\prodapp.txt -s "Product Info" -t ")

    I am guessing that it may not like the two sets of double quotes. Is it
    possible to do this? The company is not willing to spend $$$$$ on
    actual sendmail package. Any help on cleaning this up would be much
    appreciated

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Porky, Dec 1, 2003
    #1
    1. Advertising

  2. Porky

    Steven Burn Guest

    ExecCmd("blat .\prodapp.txt -s " & chr(34) & "Product Info " & chr(34) & "-t
    ")


    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    Disclaimer:
    I know I'm probably wrong, I just like taking part ;o)


    Porky <> wrote in message
    news:...
    >
    >
    > I have an asp page that successfully writes out the form data to a text
    > file. I would like to use Blat (or other free email utility) to send
    > the contents of the text file to a user. The code to email is as
    > follows:
    >
    > Dim stdout, shell, cmd
    > function ExecCmd(cmdline)
    > set stdout = wscript.stdout
    > set shell = createobject("wscript.shell")
    > set cmd = shell.Exec(cmdline)
    > do until cmd.status=1: wscript.sleep 5:loop
    > ExecCmd = cmd.stdout.readall
    > End Function
    >
    > ExecCmd("blat .\prodapp.txt -s "Product Info" -t ")
    >
    > I am guessing that it may not like the two sets of double quotes. Is it
    > possible to do this? The company is not willing to spend $$$$$ on
    > actual sendmail package. Any help on cleaning this up would be much
    > appreciated
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Steven Burn, Dec 1, 2003
    #2
    1. Advertising

  3. Porky

    Jeff Cochran Guest

    >I have an asp page that successfully writes out the form data to a text
    >file. I would like to use Blat (or other free email utility) to send
    >the contents of the text file to a user. The code to email is as
    >follows:
    >
    >Dim stdout, shell, cmd
    >function ExecCmd(cmdline)
    >set stdout = wscript.stdout
    >set shell = createobject("wscript.shell")
    >set cmd = shell.Exec(cmdline)
    >do until cmd.status=1: wscript.sleep 5:loop
    >ExecCmd = cmd.stdout.readall
    >End Function
    >
    >ExecCmd("blat .\prodapp.txt -s "Product Info" -t ")
    >
    >I am guessing that it may not like the two sets of double quotes. Is it
    >possible to do this? The company is not willing to spend $$$$$ on
    >actual sendmail package. Any help on cleaning this up would be much
    >appreciated


    Escape the double quotes by doubling them. Or use an ASP method to
    send the info without going to the trouble of writing a text file.

    Jeff
     
    Jeff Cochran, Dec 1, 2003
    #3
  4. Porky

    Porky Guest

    I have modified the asp code as suggested. Now, when I run it, I get
    "Microsoft VBScript runtime (0x800A01A8) Object required: 'wscript' " on
    line 61 which is

    set stdout = wscript.stdout

    in the code


    Dim stdout, shell, cmd
    function ExecCmd(cmdline)
    set stdout = wscript.stdout
    set shell = createobject("wscript.shell")
    set cmd = shell.exec(cmdline)
    do until cmd.status = 1: wscript.sleep 5: loop
    ExecCmd = cmd.stdout.readall
    End Function

    ExecCmd (".\blat.exe .\prodapp.txt -s " & chr(34) & "Product
    Application Form" & chr(34) & " -t ")

    I know I am hitting all around the mark, but haven't quite got it. The
    answer is probably painfully obvious as well.

    Thanks for the help


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Porky, Dec 1, 2003
    #4
  5. Porky

    Steven Burn Guest

    thats because your trying to use it before it's been created.

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    Disclaimer:
    I know I'm probably wrong, I just like taking part ;o)


    Porky <> wrote in message
    news:e2i#...
    >
    > I have modified the asp code as suggested. Now, when I run it, I get
    > "Microsoft VBScript runtime (0x800A01A8) Object required: 'wscript' " on
    > line 61 which is
    >
    > set stdout = wscript.stdout
    >
    > in the code
    >
    >
    > Dim stdout, shell, cmd
    > function ExecCmd(cmdline)
    > set stdout = wscript.stdout
    > set shell = createobject("wscript.shell")
    > set cmd = shell.exec(cmdline)
    > do until cmd.status = 1: wscript.sleep 5: loop
    > ExecCmd = cmd.stdout.readall
    > End Function
    >
    > ExecCmd (".\blat.exe .\prodapp.txt -s " & chr(34) & "Product
    > Application Form" & chr(34) & " -t ")
    >
    > I know I am hitting all around the mark, but haven't quite got it. The
    > answer is probably painfully obvious as well.
    >
    > Thanks for the help
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Steven Burn, Dec 1, 2003
    #5
  6. > set stdout = wscript.stdout
    > set shell = createobject("wscript.shell")


    I think you need to change the order of these two lines. How can you grab a
    property from an object you haven't yet created?

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
     
    Aaron Bertrand [MVP], Dec 2, 2003
    #6
  7. Sorry, I need to read more carefully.
     
    Aaron Bertrand [MVP], Dec 2, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Farooq Khan

    emailing in ASP.NET

    Farooq Khan, Dec 29, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    857
    Farooq Khan
    Dec 30, 2003
  2. Gary Coutts

    Emailing a dynamically generated aspx page

    Gary Coutts, Apr 20, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,062
    Gary Coutts
    Apr 23, 2006
  3. tshad
    Replies:
    2
    Views:
    333
    tshad
    May 19, 2006
  4. Replies:
    9
    Views:
    1,304
  5. Jess

    Attach file to Page for Emailing

    Jess, Aug 24, 2006, in forum: ASP General
    Replies:
    5
    Views:
    124
    Steven Burn
    Aug 24, 2006
Loading...

Share This Page