Adding an Email Link

If you want to invite your site visitors to email you, an email link is the perfect solution. When someone clicks an email link, his email program launches automatically, and a new message opens with your email address already in the “To:” field. Your guest can then just type his message and send it off.

An email link looks like this: mailto:. The first part (mailto) indicates the type of link, while the second part () specifies the email address.

Note

Email links work only if the person who clicks the link has an email program set up and running on his computer. If someone visits your site from a computer at the public library, for example, he might not be able to send email. Likewise, if he’s using a web-based email client, like Gmail, clicking an email link won’t open his Gmail page in a web browser.

You can create an email link much the way you create any other Dreamweaver link: by selecting text or an image and typing the mailto address, as shown above, into the Property Inspector’s Link field. To simplify this process, Dreamweaver offers a quick way to insert an email link:

  1. Under the Insert panel’s Common category, click the “Email link” icon, which looks like an envelope (see Figure 4-7).

    Alternatively, choose Insert→Email Link. Either way, if you already typed the text (Email me!) on your web page, select it first. The Email Link dialog box opens (see Figure 4-9).

    The Email Link dialog box lets you specify the text for the email link and the email address. You can also select text in your document and click the Email Link icon on the Objects panel. The text you select appears in the Text field in this dialog box.

    Figure 4-9. The Email Link dialog box lets you specify the text for the email link and the email address. You can also select text in your document and click the Email Link icon on the Objects panel. The text you select appears in the Text field in this dialog box.

  2. In the Text field, type the text that you want to appear on the web page.

    This text can indicate the link’s purpose, like Email the webmaster. (If you select text in the document first, it automatically appears in the Text field.)

  3. Type an email address into the Email field.

    This is the address that appears in your visitors’ email program when they click the link. (You don’t have to type mailto:—Dreamweaver adds it automatically.)

  4. Click OK.

    Dreamweaver adds the text to the page, complete with a mailto link.

Note

Some people don’t add email links to their websites because they’re afraid of spammers’ automated programs that search the web and collect email addresses. There are some tricks to fool these “spambots,” but spammers have figured most of them out. The fact is, spammers can attack even “Contact Us” web forms.

If you’re absolutely obsessed with never being spammed, leave your email address off your site. However, many businesses rely on people contacting them for more information, and the harder you make it for a legitimate visitor to contact you, the fewer legitimate contacts you’ll receive—after all, you wouldn’t have much of a freelance design business if you never provided a way for someone to contact you. Your best bet is to let the spam come, but add a spam filter to your email program to separate the wheat from the chaff.

Get Dreamweaver CS6: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.