Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 09:52 AM
Porky
Guest
 
Posts: n/a
Default ASP Page emailing text file



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 user@domain.com")

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!
  #2  
Old July 19th, 2005, 09:52 AM
Steven Burn
Guest
 
Posts: n/a
Default Re: ASP Page emailing text file

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


--

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 <scrooge@noemail.net> wrote in message
news:u1HgSzEuDHA.3496@TK2MSFTNGP11.phx.gbl...[color=blue]
>
>
> 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 user@domain.com")
>
> 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![/color]


  #3  
Old July 19th, 2005, 09:52 AM
Jeff Cochran
Guest
 
Posts: n/a
Default Re: ASP Page emailing text file

>I have an asp page that successfully writes out the form data to a text[color=blue]
>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 user@domain.com")
>
>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[/color]

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
  #4  
Old July 19th, 2005, 09:53 AM
Porky
Guest
 
Posts: n/a
Default Re: ASP Page emailing text file


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 user@userdomain.com")

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!
  #5  
Old July 19th, 2005, 09:53 AM
Steven Burn
Guest
 
Posts: n/a
Default Re: ASP Page emailing text file

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 <scrooge@noemail.net> wrote in message
news:e2i#DSGuDHA.3144@tk2msftngp13.phx.gbl...[color=blue]
>
> 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 user@userdomain.com")
>
> 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![/color]


  #6  
Old July 19th, 2005, 09:53 AM
Aaron Bertrand [MVP]
Guest
 
Posts: n/a
Default Re: ASP Page emailing text file

> set stdout = wscript.stdout[color=blue]
> set shell = createobject("wscript.shell")[/color]

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/






  #7  
Old July 19th, 2005, 09:53 AM
Aaron Bertrand [MVP]
Guest
 
Posts: n/a
Default Re: ASP Page emailing text file

Sorry, I need to read more carefully.


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles