Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send page by email button

Status
Not open for further replies.

werdina

Technical User
Jun 2, 2007
5
GB
I was asked to put a button on the intranet maps pages that would enable users to click on it and email the whole page. Is this possible? I do not have any idea on how to do this so I will appreciate any input.

Thanks.
 
You won't be able to do it just by placing a button there.

I'm assuming you aren't talking about something as simple as emailing the actual URL (since surely this would not work outside the intranet).

I imagine you could create an email form where you typed in the details (to, from, subject and content) and clicking a button sent the email and along the way attached some inline HTML to the message body. This would mean that they couldn't use their standard email client to do it - and would have to use the special form on the intranet site).

It would also require some server-side coding to process the email details and add in the HTML to the message body before sending it.

There are likely to be other suggestions. Maybe providing a linked PDF of the page that you encourage users to save locally and drag into emails they create would suffice.

Just some ideas.

Jeff


[tt]Jeff's Page [!]@[/!] Code Couch
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Ask them if you can code it in PHP/ASP, as it's not very to do server-side.

If you cant, afaik the only sollution will be to use an mailto: href.

eg.:
<a href="mailto:account@domain.tld?subject=the subject&body=This is the body">Send the page</a>

If you wish to have this link generated dynamically, you can use JS to change the href.

Eg. you can check out the DOM code here to change href:

You can then set the href so that the reciepent email gets filled from a textbox maybe?

Not sure of your purpose.

ps. be aware that outlook express will crash, if the body exceeds 456 chars in length, but you can simply shorten the text.

To get the text to send, you could maybe do:
var body = document.getElementById('myWebContent').innerHTML.substring(0,255)+'...\n\nRead the article here: '+document.URL;

ps. take this as psuedocode

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top