subject in email -

Brooke's picture

She has: 681 posts

Joined: Feb 1999

When you have an email link on your site, it brings up the visitors mail program when they click on it. My question is, can you put an automatic subject in the subject line?

Brooke

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

Yes, you can supply a subject by adding what is called a "query string" to the end of your email address. A query string starts with a question mark (?) followed by your
input. In this case, we want to add

?subject=your subject

So, to make "Hi There" the subject, you would write the link like this:

<A HREF="mailto:[email protected]?subject=Hi There">Email Me</A>

Hope this helps,

------------------
John Pollock
http://www.pageresource.com
http://www.javascriptcity.com

Brooke's picture

She has: 681 posts

Joined: Feb 1999

Thank you so much! That worked great!

You can see it at: http://www.shoulderhorn.com

Brooke

They have: 2,390 posts

Joined: Nov 1998

This is also pretty good as a replacement for a HTML feedback form:
<A HREF="mailto:[email protected]?body=name:...">Email Me</A>
JP

They have: 46 posts

Joined: Sep 1999

I don't know about that... I still think feedback forms are better than the mailto links, no matter what you do to them.

------------------
Brian Farkas
===============
Web Hosting - Design - Programming
http://www.infostardesign.com

Free webmaster tips, tricks, web host reviews, and more!
http://www.etips.net
===============

They have: 2,390 posts

Joined: Nov 1998

Brian,
You are right but many feedback forms have an email link below them, this method would be a good bridge between the two.
JP

------------------
The Webmaster Promotion and Resource Site
www.what-next.com
The NEXT step in Designing and Promoting your Website

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.