Open standard e-mail app with subject and body preset

P

Peter Amberg

I would like to create a link on my page that opens the standard
e-mail application when someone clicks it. It should have at least the
subject preset, better if I could preset the body as well. I read
somewhere that the TITLE attribute of the A HREF tag can be used to
set a subject, so I tried:

<A HREF="mailto:" TITLE="MySubject">

This would open the e-mail application, but the TITLE attribute is
completely ignored, at least on Win2k/Outlook Express. I wonder if
there is some way in JavaScript? If it can even not be done in
JavaScript, has anyone an idea how I could do this???

Thanks in advance,
Peter
 
K

kaeli

I would like to create a link on my page that opens the standard
e-mail application when someone clicks it.

What if there isn't one?

Schools don't have a default e-mail client.
Internet cafes don't have a default e-mail client.
People who use web based mail (either through their ISP or
yahoo/hotmail/etc) don't have a default e-mail client.
People who use text based mail such as PINE don't have a default e-mail
client.
People who use many browsers but don't configure the mail settings don't
have a default e-mail client.
People who don't want you to know their e-mail address don't use their
default e-mail client.

Using mailto is a Bad Idea unless you've got an intranet application and
you know everyone has, say, Outlook and Windows. Everything else should
use a server-side script to mail a form. There's free formmail scripts
out there, so no excuses. :)

That all said...
<a href="mailto:[email protected]?subject=mySubject">link</a>
will work in many clients. But not all. Nothing works on ALL clients,
which is another reason why mailto is evil. ;)

--
 
R

Randy Webb

Peter said:
I would like to create a link on my page that opens the standard
e-mail application when someone clicks it. It should have at least the
subject preset, better if I could preset the body as well. I read
somewhere that the TITLE attribute of the A HREF tag can be used to
set a subject, so I tried:

<A HREF="mailto:" TITLE="MySubject">

This would open the e-mail application, but the TITLE attribute is
completely ignored, at least on Win2k/Outlook Express. I wonder if
there is some way in JavaScript? If it can even not be done in
JavaScript, has anyone an idea how I could do this???

Save yourself a ton of headaches. If you want to send email, send it
with a form from the server.
<URL: http://www.isolani.co.uk/articles/mailto.html >
 
6

620

It does work with OE/IE 6. The link your newsreader may have generated in
my post is not valid.
 
K

kaeli

It does work with OE/IE 6. The link your newsreader may have generated in
my post is not valid.

You assume OE because...?

(the whole point is that not everyone HAS OE - just because the OP
specified it doesn't mean only he alone needs it)


--
 
R

Randy Webb

kaeli said:
You assume OE because...?

(the whole point is that not everyone HAS OE - just because the OP
specified it doesn't mean only he alone needs it)
Give up kaeli, the concept eludes him.
 
P

Peter Amberg

Randy Webb said:
Save yourself a ton of headaches. If you want to send email, send it
with a form from the server.

That's what we have. The problem is, some guys are using our form to
send spam through our server. Not nice. We are going to close the SMTP
port of our server. The link that was suggested by 620 works for our
system. Most other systems will at least open an empty mail window
even if they do not understand the ?subject&body stuff, so it seems to
be a nice solution. Thanks, 620!

Cheers,
Peter
 
R

Randy Webb

Peter said:
That's what we have. The problem is, some guys are using our form to
send spam through our server. Not nice. We are going to close the SMTP
port of our server. The link that was suggested by 620 works for our
system. Most other systems will at least open an empty mail window
even if they do not understand the ?subject&body stuff, so it seems to
be a nice solution. Thanks, 620!

Thats up to you, but mailto is *very* unreliable, see the other threads
the last few days.
 
6

620

I assume nothing - I merely made a suggestion to the OP. The only thing I
do assume is that the multi-platform issue is 100%, *blatantly* obvious to
everyone involved web development, and the issue doesn't need to be pointed
out again and again, and again, and again, as the typical "comp.lang.js
holier-than-thou elite" crowd seems to think is so ridiculously necessary to
do.

Excuse the **** out of me for trying to help someone.
 
6

620

Hey, if the shoe fits...

You're very welcome.

Peter Amberg said:
Randy Webb <[email protected]> wrote in message

That's what we have. The problem is, some guys are using our form to
send spam through our server. Not nice. We are going to close the SMTP
port of our server. The link that was suggested by 620 works for our
system. Most other systems will at least open an empty mail window
even if they do not understand the ?subject&body stuff, so it seems to
be a nice solution. Thanks, 620!

Cheers,
Peter
 
K

kaeli

I assume nothing - I merely made a suggestion to the OP. The only thing I
do assume is that the multi-platform issue is 100%, *blatantly* obvious to
everyone involved web development,

Don't assume that.
Surfing around enough would prove the opposite. The number of sites that
use mailto alone would tell you how the issue with it is not a well
known one. Even tutorial sites tell people to use it. Commercial sites
use it.
You're giving people too much credit. Most people who do development
start out like I did - with simple tutorial sites, none of which push
home the fact that not all browsers do all things. At least they don't
stress it enough, IMO.

We hammer it in because we see it over and over and over...and because
most people who post here honestly don't know about these issues.
They're new. We were all new at some point in time.

Crap, a good quarter of the *commercial* sites I visit don't work nice
in Opera because of their stylesheets alone. Much less people's personal
sites or small business sites. And, even worse, browser detection that
relies on the navigator name.

Heck, I didn't know about relative font sizes being preferable (and why)
until after I'd been coding small sites for over 3 years. No one told
me.

--
 
T

Thomas 'PointedEars' Lahn

kaeli said:
People who use text based mail such as PINE don't have a default e-mail
client.

You stated this previously, and it is still wrong if said globally.
Even `pine' and other text based e-mail clients can be configured
as default e-mail client, e.g. in `lynx' with the file_editor and
personal_mail_address settings in the .lynxrc configuration file.
However,
People who use many browsers but don't configure the mail settings don't
have a default e-mail client.
People who don't want you to know their e-mail address don't use their
default e-mail client.
[...]

is certainly true.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top