rtod2
asked on
mailto code to format email with title of page
I need to code a mailto button that will use the user's default mail program to mail a link to whatever page they are looking at on my Wordpress site at www.frugalmule.com. Assistance is greatly appreciated.
Mail it to whom? Mailto needs a target...
ASKER
Whoever they put in?
mailto doesn't work that way. You can do:
<a href="mailto:someaddress@s omedomain. com">Click here to send me an email</a>
What you are talking about is some form of sharing thing. I recommed getting the AddThis plugin:
http://wordpress.org/extend/plugins/addthis/
<a href="mailto:someaddress@s
What you are talking about is some form of sharing thing. I recommed getting the AddThis plugin:
http://wordpress.org/extend/plugins/addthis/
You can do it with javascript, but you might want to repost in the javascript zone for a javascript expert to help you with that.
You need to listen for a blur event on the input field and then put the contents of the input box into the href attribute of the <a> tag.
It's not THAT difficult, but I can't do it off the top of my head (yet) and I'm logging off for the night.
You need to listen for a blur event on the input field and then put the contents of the input box into the href attribute of the <a> tag.
It's not THAT difficult, but I can't do it off the top of my head (yet) and I'm logging off for the night.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Scratch that... try this
<label>Email Address: </label>
<input type="text" id="send_email" onBlur="document.getElementById('email_link').href = 'mailto:' + this.value + '?subject=Check Out This Link&body=' + document.URL; ">
<a href="javascript:void(0)" id="email_link">Click to Send Email</a>
ASKER
gwkg,
Thank you! That works well here http://www.frugalmule.com/assist-me/ except that it appears to create a form which I can do without. Also, the title should take the same name as the link except capitals and not spaces (assist-me becomes Assist Me). The link itself should only state the last part of the URL explicitly (eg. assist-me). Thank you sir.
Thank you! That works well here http://www.frugalmule.com/assist-me/ except that it appears to create a form which I can do without. Also, the title should take the same name as the link except capitals and not spaces (assist-me becomes Assist Me). The link itself should only state the last part of the URL explicitly (eg. assist-me). Thank you sir.
ASKER
related question on the way
ASKER
follow-up question here >> https://www.experts-exchange.com/questions/27431771/Modify-mailto-code.html
I replied in your follow up, but how are you going to know where to email the link if you don't have an input field for the user to type it in?