Button for users to email themselves

correlate
correlate used Ask the Experts™
on
Dear Experts,

I am trying to create an HTML button to allow a user to email themselves a particular link (this link will be hard coded into the code)

The email address to send the email is basically the user's network name

Can anybody help?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ImaCircularSawTechnical Lead

Commented:
Check the mailto syntax:

http://www.ianr.unl.edu/internet/mailto.html

As for gettintg the right content into the link, what webhsite is it and how do they access it?  Obviously, you'll need something to query for the user's details.  Is it an authenticated intranet?

Author

Commented:
The Website is a Sharepoint 2010 Intranet, it is an authenticated intranet
ImaCircularSawTechnical Lead

Commented:
In which case, you could do two things, you could write a SharePoint webpart that gets the user's account details.  You could also use some javascript on the page to get the content of the top-right control which has the user's name in and use that to construct an email address etc.

Is the email address similar to the following:

<firstname>.<lastname>@company.com
<initial><lastname>@company.com

I'll see if I can fine some code I used before to do something similar.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Technical Lead
Commented:
Actually, check out this link:

http://stackoverflow.com/questions/5358035/sharepoint-get-current-user-attribute

Looks like some really good jQuery stuff you could use to get SP parameters.  Hope this helps!
ImaCircularSawTechnical Lead

Commented:
http://www.learningsharepoint.com/2011/05/11/get-current-loggedin-user-in-sharepoint-using-javascript/

This would also work as long as you can manipulate it to construst an email address from the information retrieved.

Author

Commented:
Hi Thanks for this,

I have tried using a work flow in sharepoint to achieve this, but couldnt find a way of starting the workflow when a user simply clicks either a field or a button.

I'm also wading my way through the Stackoverflow link

Author

Commented:
Many thanks for this - the project went on hold for a bit and when it came live again I revisited this & got it to work

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial