winkle
asked on
mailto: extendability
I'm trying to figure out how (or if) I can get a mailto: link to automatically insert some starter text into the mail message. Has anyone come across a way to do this?
Thanks
Thanks
Nevermind that last one, I had to fix something on it ...
Revised:
<SCRIPT language="JavaScript">
<!--
/* Mailto enhancement */
function e_friend()
{
var e_add= 'you@youraddy.com';
var subj= 'your subject here';
if ((subj==" ") || (subj==null))
subj="Hi!";
window.location="mailto:"+ e_add+"?su bject="+su bj;}
//-->
</SCRIPT>
Use this as the link:
<A HREF="javascript:e_friend( )">Email</ A>
Revised:
<SCRIPT language="JavaScript">
<!--
/* Mailto enhancement */
function e_friend()
{
var e_add= 'you@youraddy.com';
var subj= 'your subject here';
if ((subj==" ") || (subj==null))
subj="Hi!";
window.location="mailto:"+
//-->
</SCRIPT>
Use this as the link:
<A HREF="javascript:e_friend(
<a href="mailto:me@mydomain.c om?subject =hello&bod y=what is this">Mail me</a>
£.
£.
Or use the CDONTS object from ASP (that is IF you can use ASP)
Hey!
lambda's answer is the easiest, but please note, that this won't work with all browsers / mail clients.
- Tarraq
lambda's answer is the easiest, but please note, that this won't work with all browsers / mail clients.
- Tarraq
lease note that you won't be able to have a subject with spaces.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is a space before the message body ... try replacing this line:
window.location="mailto:"+ e_add+"?su bject="+su bj+"&body= "+e_body;}
with this one ...
window.location="mailto:"+ e_add+"?su bject="+su bj+"&body= "+e_body;}
:)
window.location="mailto:"+
with this one ...
window.location="mailto:"+
:)
You might wanna use the replace function to replace the body text etc with %20 (which is supposed to be a space)
CJ,
I tryed it like this ...
<SCRIPT language="JavaScript">
<!--
/* Mailto enhancement - Place this in the head of the document */
function e_friend()
{
var e_add= 'you@youraddy.com';
var subj= 'your subject here';
var e_body= 'message text goes here ...';
window.location="mailto:"+ e_add+"?su bject="+su bj+"&body= "+e_body;}
//-->
</SCRIPT>
It works good. As of yesterday I'm using it on my site for people to unsubscribe to my mailing list. It's funny, but this isn't the first thing I've coded becuase the idea was spawned here at the ee. Many thanks to the Experts-Exchange.
I tryed it like this ...
<SCRIPT language="JavaScript">
<!--
/* Mailto enhancement - Place this in the head of the document */
function e_friend()
{
var e_add= 'you@youraddy.com';
var subj= 'your subject here';
var e_body= 'message text goes here ...';
window.location="mailto:"+
//-->
</SCRIPT>
It works good. As of yesterday I'm using it on my site for people to unsubscribe to my mailing list. It's funny, but this isn't the first thing I've coded becuase the idea was spawned here at the ee. Many thanks to the Experts-Exchange.
quote:
This will produce the results you want. Just reject it if you want to try another way, but the only way I think your going to have spaces in the message subject and body is to use some sort of scripting.
quote:
It works good. As of yesterday I'm using it on my site for people to unsubscribe to my mailing list. It's funny, but this isn't the first thing I've coded becuase the idea was spawned here at the ee. Many thanks to the Experts-Exchange.
And you tested it with spaces and stuff too?????.......uhm......wh ichn of your comment is true?
This will produce the results you want. Just reject it if you want to try another way, but the only way I think your going to have spaces in the message subject and body is to use some sort of scripting.
quote:
It works good. As of yesterday I'm using it on my site for people to unsubscribe to my mailing list. It's funny, but this isn't the first thing I've coded becuase the idea was spawned here at the ee. Many thanks to the Experts-Exchange.
And you tested it with spaces and stuff too?????.......uhm......wh
uh ...
I don't know what your asking but you can go to my site and click the link to be removed from the mailing list at the bottom of the products page
http://fibdev.com/products.htm#produpmail
Just click where it says "Click here" in the blue box.
I don't know what your asking but you can go to my site and click the link to be removed from the mailing list at the bottom of the products page
http://fibdev.com/products.htm#produpmail
Just click where it says "Click here" in the blue box.
Just checked it, you're right.
waiting ... :)
ASKER
Thanks. Both methods worked very well. (spaces included)
<SCRIPT language="JavaScript">
<!--
/* Mailto enhancement */
function e_friend()
{
var e_add= 'you@youraddy.com';
var subj= 'your subject here';
var e_body= 'enter some text here';
if ((subj==" ") || (subj==null))
subj="Hi!";
window.location="mailto:"+
//-->
</SCRIPT>
Use this as the link:
<A HREF="javascript:e_friend2
This may work too ...
<a href="mailto:you@youraddy.