Forum Moderators: open

Message Too Old, No Replies

mailto links

         

Mr_Cat

1:19 pm on Nov 11, 2008 (gmt 0)

10+ Year Member



Hi folks,

is it possible to put a subject and maybe some standard text in an e-mial using the mailto: function, or do I need something else? I'd like to do that, but from a simple e-mail link as opposed to any kind of comment form or something.

Cheers

wyweb

2:20 pm on Nov 11, 2008 (gmt 0)




<a href="mailto:recipient@example.com?subject=This is the subject line">mailto link</a>

Mr_Cat

2:33 pm on Nov 11, 2008 (gmt 0)

10+ Year Member



Great, thanks! :)

mcfly

12:54 pm on Nov 12, 2008 (gmt 0)

10+ Year Member



Taking it further, you can also do &body=some_text including URL encoded linefeeds to control the whitespace.

piatkow

2:37 pm on Nov 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I tried to do a lot with mailto links in my early days (free hosting, no PHP) but I did find that &body was not consistently supported between email clients.

These days I find webmail so convenient that one of my two machines doesn't even have an email client configured. I also know quite a few people who do use webmail exclusively. Personally I woudln't dream of excluding a such large proportion of my visitors by using a mailto.

Mr_Cat

3:02 pm on Nov 12, 2008 (gmt 0)

10+ Year Member



Not quite sure what you mean by exclude? You mean having a form is better?

I have a contact page on my site with e-mail and a feedback form too that uses the form to mail software on the server I've got, but it's a reasonable sized site with news of different projects here and there and the odd mailto link just seems to be nice and handy. It's a community based site which I'm estimating isn't going to have a huge amount of traffic haha but I really don't have an 'average user' type estimated, so I'm trying to make it easy as possible for everyone.

I wanted to use the mailto link as I have a feedback@ and an info@ address where people might want more info on a particular story, and I thought the easiest way to do this and make it useful as possible for the person recieving it would be to specify some basic body text and a title relevant to the context the mailto link is in.

I hope that made sense.
Maybe I'm being a bit old fashioned tho!? I'm only aware of having a form for the user to fill out online, or a mailto link.

Thanks for the help!

Samizdata

5:12 pm on Nov 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You mean having a form is better?

I would say a lot better.

A huge number of people only use web-based email (Gmail, Hotmail, whatever) and will be unable to use the (unconfigured) default email client that you launch for them from the "mailto" link.

There is nothing to stop you specifying the subject and some default text in a form.

...

[edited by: Samizdata at 5:13 pm (utc) on Nov. 12, 2008]

Mr_Cat

5:45 pm on Nov 12, 2008 (gmt 0)

10+ Year Member



Hmm, so in the context of a random news article on the site, and a "contact info@blah.com" within it, how best then to make this clickable...or should I just not bother! Yea I never thought about that many people using only the web based mails, it's been that long since I've had to do anything like this haha.

Can you do it with some kind of hidden form or something?

Samizdata

6:06 pm on Nov 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can you do it with some kind of hidden form or something?

You need a visible form so they can input their email address (at the very least).

or should I just not bother!

Your choice Mr_Cat.

...

Mr_Cat

6:37 pm on Nov 12, 2008 (gmt 0)

10+ Year Member



hmm that's what I thought, thanks very much :D
maybe I'll just un-link the mailto links to save pissing people off!

Cheers again