|
Links to Email Addresses
| [Previous] [Main] [Next] |
|
| |
| Hyperlinks can be created that automatically invoke the user's email program to send a message to a specific address. To do this, create a normal hyperlink using htmlHyperLink, but instead of specifying the URL of a website, include the keyword "mailto:" followed by the desired email address. The following code snippets are all functionally equivalent:
| |
|
| |
| // example 1
| |
| page << htmlHyperLink( "mailto:info@dcmicro.com",
| |
| "Click here to send a message." ) ;
| |
|
| |
| // example 2
| |
| htmlHyperLink mail_link( "mailto:info@dcmicro.com" ) ;
| |
| page << ( mail_link << "Click here to send a message." ) ;
| |
|
| |
| // example 3
| |
| htmlHyperLink mail_link ;
| |
| mail_link.URL( "mailto:info@dcmicro.com" ) ;
| |
| mail_link << "Click here to send a message." ;
| |
| page << mail_link ;
| |
|
| |
| Each of the above examples produce the following HTML output:
| |
|
| |
| <A HREF="mailto:info@dcmicro.com">Click here to send a message.</A>
| |
|
| |
|
| |
