Welcome to WebmasterWorld Guest from 54.226.32.234

Forum Moderators: phranque

Message Too Old, No Replies

Is there another way

Automatic Subject and Body in Email

     

spherica

7:17 pm on Jul 8, 2003 (gmt 0)

10+ Year Member



I have been getting a site together, and have tryed getting the Subject and Body to be automatic in a mailto <a href=" and this is the closest I've got.

<a href="mailto:whoever.com?subject=Link%20Request&body=Can%20I%20link%20to%20you">

This works in some email browsers, butnot in all it shows the %20 between the words,

Is there another way or is this about it?

broniusm

7:52 pm on Jul 8, 2003 (gmt 0)

10+ Year Member



spherica-
I've been successful with just putting it in straight without escaping the string:
<a href="mailto:goodfolks@webmasterworld.com?subject=This is a great place to learn">email</a>

Try that and see how browser-generic it is for ya.

spherica

8:23 pm on Jul 8, 2003 (gmt 0)

10+ Year Member



<a href="mailto:goodfolks@webmasterworld.com?subject=This is a great place to learn">email</a>

That will load the Subject, what about adding the Body?

broniusm

9:15 pm on Jul 8, 2003 (gmt 0)

10+ Year Member



well, right, then add the body in the same way as you did but without the url-encoded chars:
"mailto:subject=Info Request&body=Looking for Info about my Big Toe"

Consider also that it's pretty darn easy to set up a PHP email contact form or ASP form if you have access to that. For instance, I use hotmail for everything, so clicking mailto links for me stinks for me. This will allow anyone and his dog to fill out the form, and you can even include "required fields" like phone number, etc.

spherica

11:47 pm on Jul 8, 2003 (gmt 0)

10+ Year Member



can you give me an example of a php or asp email please

and thanks for the help

broniusm

2:14 pm on Jul 9, 2003 (gmt 0)

10+ Year Member




Here's a free one for ASP:
[aspemail.com...]

And I believe this is "built in" with PHP:
[us4.php.net...]

Lots of examples out there in Google for each. Forms look much more professional online and are easier for users to use.

spherica

1:24 pm on Jul 16, 2003 (gmt 0)

10+ Year Member



Thanks for the info

spherica

5:02 pm on Jul 24, 2003 (gmt 0)

10+ Year Member



If I could back up a bit

with the & sign the page will not validate at w3c. Is there a solution beside going to a different setup or is that the only way?

Sorry, I did a search in the archives, but did not find a solution to my prob.

universalis

5:22 pm on Jul 24, 2003 (gmt 0)

10+ Year Member



with the & sign the page will not validate at w3c

Try replacing & with &amp; - that should do the trick.

Having said that, I too would usually favor using a PHP or perl script and a web form rather than a mailto: link opening the user's email client. Their email client may not be configured correctly, or they may be on a public computer, or they may have a hotmail address, etc., whereas a web form will work fine in these cases. What's more, using a web form with a hidden recipient email address means that your address will be better protected from spam-bots scanning your pages for email addresses.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month