I stumbled upon this the other day, though in hindsight, it's obvious that it would be there. Just as with the hyperlinks in HTML, you can use the hyperlink in Silverlight to invoke the user's default mail client. This is commonly referred to as a "mailto" link.

To do it, just set the hyperlink's "NavigateUri" property to "mailto:" and add the email address. To add a subject, follow up the email address with a "?Subject=" and whatever you'd like the default subject to be. For example, the following code would open up the client's default email program with a mail to the address you fill in.

NavigateUri="mailto:NAME@DOMAIN.COM?Subject=Silverlight Hyperlink"

Very useful for sharing a site via a "Send to a friend" link or something similar. In that case, you would want to omit the "NAME@DOMAIN.COM" part shown above to allow the user to fill it in on their own.

Probably also very useful for "Contact Us" or "Send Feedback" links since the spambots probably can't see the content inside a Silverlight application.

2 Responses to “Sending email from Silverlight…”

  1. Dew Drop - Weekend Edition - November 15-16, 2008 | Alvin Ashcraft's Morning Dew says:

    [...] Sending Email from Silverlight (Jeff Paries) [...]

  2. 2008 November 17 - Links for today « My (almost) Daily Links says:

    [...] Jeff Paries on Sending email from Silverlight [...]

Leave a Reply