Solved

E-mail Form as it looks on screen as attachment

Posted on 1998-12-07
6
210 Views
Last Modified: 2013-12-25
I want to send the document which is previewed in browser by a press of a single button for printer as well as an E-mail to two or three persons as an attachment.
Example: If u are viewing a site and u want the site as it is viewed to be E-mailed to your friend as attachment.How u will do it?Please help me out
0
Comment
Question by:vipin072998
6 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 1856940
I would try something like the following:
Using javscript:

<script>
function send()
{
   document.print();
   document.formname.submit();
}
</script>

<form name=formname action="mailto:<all the addresses in comma separated list>">
..form elements....
<input type=button value=submit onClick="javascript: send(); return true;">
</form>

try it out.

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 1856941
oops :)
forgot about the submitting the page part.  I haven't quite figured that out yet...
you could just add the following so they send a link:

replace All of the above (it had a few bugs I didn't test) with the following:

<form method=post name=formname onSubmit="document.formname.action" ENCTYPE="text/html">
<INPUT TYPE="hidden" NAME="URL" VALUE="javascript: document.location;">
<input type="hidden" name="tolist" value="cj.jouhal@lmco.com,cj.jouhal@lmco.com">
<input type="hidden" name="subject" value="test">
<INPUT TYPE="hidden" NAME="mail" VALUE="">
<script>
      document.formname.action='mailto:'+document.formname.tolist.value+'?subject='+document.formname.subject.value;
</script>
<input type=file name=file1 value="">
<script>
      document.formname.action='mailto:'+document.formname.tolist.value+'?subject='+document.formname.subject.value;
      document.formname.file1.value=document.location;
</script>

      <input type=submit value=submit>
      </form>


CJ
0
 
LVL 3

Expert Comment

by:hkp
ID: 1856942
I believe this would require the recipient to have an HTML enabled email program.

Why not deliver a link? You would have to be able to get all the used files on the page, and change the hrefs. Not an easy task.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 3

Expert Comment

by:hkp
ID: 1856943
I believe this would require the recipient to have an HTML enabled email program.

Why not deliver a link? You would have to be able to get all the used files on the page, and change the hrefs. Not an easy task.
0
 

Accepted Solution

by:
ajoy092498 earned 40 total points
ID: 1856944
For sending the html page as an attachement by mail, you can use NewMail object of CDONTS component that comes with IIS4.0
0
 

Author Comment

by:vipin072998
ID: 1856945
Dear Ajoy,
Can U send some sample code so that which component u are talking about.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question