ASP Page emailing text file

P

Porky

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 (e-mail address removed)")

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
 
S

Steven Burn

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


--

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)
 
J

Jeff Cochran

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 (e-mail address removed)")

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
 
P

Porky

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 (e-mail address removed)")

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
 
S

Steven Burn

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)
 
A

Aaron Bertrand [MVP]

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top