• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 4. Links > Adding an Email Link

4.3. Adding an Email Link

Whenever you want to invite your visitors to email you, an email link is the perfect solution. When someone clicks an email link, her email program launches automatically, and a new message opens with your email address already in the To field. She can then just type her message and send it off.

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


Email links work only if the person who clicks the link has an email account and an email program. If someone visits your site from a computer at the public library, for example, he might not be able to send email. If this drawback troubles you, remember that you can also collect information using a form (as discussed in Chapter 10), a feedback method that has neither the limitations nor the easy setup of an email link.

You can create an email link much the way you'd create any other Dreamweaver link: by selecting some text or an image and typing the mailto address, as shown above, into the Link field in the Property inspector. To simplify this process, Dreamweaver has a quick method of inserting an email link:

  1. On the Common tab of the Insert bar, click the Email Link icon, which looks like an envelope (see Figure 4-6).

    Alternatively, choose Insert→Email link. In either case, if you've already typed the text (Email me!) on your Web page, select it first. The Email Link dialog box opens (see Figure 4-7).

    Figure 4-7. The Email Link dialog box lets you specify the text that appears on the Web page and the email address for a mailto link. You can also select some text you've already added to the document and click the Email Link icon on the Insert bar. The text you selected is copied into the Text field in this dialog box.

    The Mysterious Triple Slashes

    Why do my links start with file:///?

    Links that begin with file:/// (as in this example: file:///D:/missing manual/book_site/cosmo/subscribe.html) aren't valid links on the Web. Rather, they are temporary addresses that Dreamweaver creates as placeholders for links to be rewritten later. (A file:/// path tells Dreamweaver where to look on your computer for the file.) You'll spot these addresses when you add document-relative links to a page that hasn't been saved, or when working with files that are outside of your site's local root folder.

    Suppose you're working on a Web page that will contain your company's legal mumbo-jumbo, but you haven't yet saved it. After adding a document-relative link that links to your home page, you notice that the path displayed in the Property inspector's Link field begins with file:///. Since your legal page hasn't yet been saved and therefore doesn't yet have a folder location, Dreamweaver can't create a link telling a browser how to get from it to the home page.

    So Dreamweaver creates a temporary link, which helps it keep track of what page to link to. Once you save the page somewhere in the site, Dreamweaver rewrites the link into a proper document-relative format and the file:/// disappears.

    Likewise, when you work with files that are outside of the local root folder, Dreamweaver can't write a proper link. (Any folder outside of the local root folder isn't part of the Web site; and there's no way to write a correct link from nowhere to somewhere.) So, if you save a page outside of the local root folder, Dreamweaver writes all document-relative links on that page as file paths beginning with file:/// To avoid this invalid-link problem, always save your Web pages in either the local root folder or a folder inside of the local root folder. To learn more about root folders and Web sites, see Chapter 14.

    When you link to a page—or add an image (Chapter 5)—that's stored outside of the local root folder, Dreamweaver has the same problem. However, in this instance, Dreamweaver gives you the option of copying the out-of-bounds file to a location of your choosing within the root folder.

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

    This should give visitors some indication of what the link does. For instance, Email the Webmaster. (If you selected text in the document first, it automatically appears in the Text field.)

  3. Type an email address into the E-Mail field.

    This is the address that appears in the user's email program when she clicks the link. (You don't have to type mailto:—Dreamweaver adds it to the email address automatically.)

  4. Click OK.

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

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint