Send a page's HTML or text as an email.

Results 1 to 6 of 6

Thread: Send a page's HTML or text as an email.

  1. #1
    Join Date
    Dec 1969
    Posts
    17

    Default Send a page's HTML or text as an email.

    This is my second posting, i haven&#039t got a reply and no solution as yet!!. so i&#039ll be more descriptive.<BR>I got a gif which says "eMail this page", when this is clicked i get another page with 2 options. email the page as HTML and email the page as text.<BR>I will be using CDONTS to send email no problem there.<BR>My question is:<BR>How do i retreive a HTML page&#039s source or text through ASP? or using javascript??<BR>Pls help me, i need to implement this feature in a site very urgently.

  2. #2
    Manoj Guest

    Default RE: Send a page's HTML or text as an email.

    I don&#039t know if I am right, but let me suggest you this.<BR><BR>As far as the source of the HTML File is concerned<BR><BR>1. If you refer to say, "XXX.HTM" , you have the source which includes all your procs, functions , meta tags etc.. <BR><BR>2.If you don&#039t want the Meta Tags all the unnecessary stuff, then you can write a File processing server[Ativx Dll] which basically clean off the .HTM Page and and give you a file which contains only the code you speify.[But then you may loose the same look and feel[Style etc] of your .htm file.<BR><BR>Manoj

  3. #3
    Join Date
    Dec 1969
    Posts
    274

    Default RE: Send a page's HTML or text as an email.

    You could use the filesystemobject to open the raw html file as a string, then spit the string out in the email. I haven&#039t used CDONTS so I don&#039t know how well this works, but using serverobjects.com&#039s aspmail thingy, after setting the content type to html this works quite well.<BR><BR>it&#039s in the iis documentation but here&#039s a brief sample:<BR>set fs = server.createobject("Scripting.FileSystemObject")< BR>set f = fs.getfile(path)<BR>set stream = f.openastextstream(1,0)<BR>set completeHtmlString = stream.readall<BR><BR>now your completeHtmlString should have the entire page.<BR><BR>However keep in mind what the other responder said about meta tags, etc.

  4. #4
    Join Date
    Dec 1969
    Posts
    75

    Default RE: Send a page's HTML or text as an email.

    Hi shashi,<BR><BR> Well I had posted the same kind of query in another forum.I had to send dynamically generated page as an email.Well to do this you would have to use a component.I think it is better if you visit actionjackson.com and do a site search for the string http component.I hope you would get an idea of sending the page as an email.<BR><BR>bye,<BR>raghu<BR><BR>I am a little curious to know if you are the shashi kiran from bmsce,bangalore.If so please reply to raghu@oyemail.com


  5. #5
    Darren Hoefgen Guest

    Default RE: Send a page's HTML or text as an email.

    Instead of actually writing HTML to the screen, assign the all the HTML to a VBSCRIPT variable, then do a response.write VARIABLENAME and it will display your page, then you can just mail with the VARIABLENAME as your message body...

  6. #6
    Join Date
    Dec 1969
    Posts
    17

    Default RE: Send a page's HTML or text as an email.

    Thanx a lot for the help guys. I&#039ve decided to use a component ASPHttp to get a pages source. it works fine with this.<BR>The other alternative was to write code using the FileSystemObject object&#039s proprties and methods but i dropped this for want of time.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •