[Javascript] Emailing page to user
Andrew Gibson
andyg at ihug.co.nz
Sat May 26 16:12:47 CDT 2001
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
I have a report which is generated with an ASP script.
I want to give the user the opportunity to email the page to
himself.
Can I do this with Javascript.
Something similar to the send page by email that is in IE maybe.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
> If you're doing this in ASP, I'd just go the ASP route for
> mailing as well.
> There are a number of components -- many of them free -- that will do the
> job for you if you don't want to use CDONTS (the built-in
> mailer). Take a
> look at www.aspdll.com for your choices here.
>
> Client-side Javascript doesn't have access to any sort of
> mail API; the
> best you'll be able to do is prompt the user's default mail
> client to send a
> message, and even then you can't include the file (especially if
> it's on the
> server). Why wouldn't the user just get the file, rather than having to
> mail it to himself?
Thanks Peter, the answer to the last part is that the client requested a
link so the user could be emailed the file in word format !
Well, I came up with a nifty solution. I used AspTear to grab the
resulting ASP generated page and save into a file. Then I just
attached the file in cdonts and sent it off to the users supplied
email.
But it was a pain, coz I saved the file with an .html extension and cdonts
just put the files contents in the body of the email !
So I changed the extension to .doc and hey presto, it sent the file as
an attachment, with the bonus the attachment opened directly in Word.
I'd had a problem earlier of how to save a HTML file as a Word attachment,
so I guess that solved that problem too!
Andrew
More information about the Javascript
mailing list