18
Nov

Calling Mailto using JavaScript

5 Comments » Popularity: 1%

This is a code snippet showing how you may call the “mailto” to open your mail program.

Calling Mailto using JavaScript

View Demo: New Window
Calling mailto via Javascript:
private void SendEmail(string email, string subject, string body)
{
     Uri uri = new Uri(String.Format("mailto:{0}?subject={1}&body={2}", email, subject, body));
     System.Windows.Browser.HtmlPage.Window.Navigate(uri);
}
  • DZone
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit

Related Posts

5 Responses to “Calling Mailto using JavaScript”

  1. mike says:

    thank. you. so. f.ing much

  2. FiscusMedia says:

    This technique opens an empty browser window before sending the mailto link to Outlook. Is there any way to disable the popup?

    • Steve says:

      I dont know if this will help you but here id what I used to call up outlook express

      function open_email(url) {
      setTimeout(”parent.location = ‘yourpage.htm’”,10);
      em=window.open(url);
      em.close();
      }

      Then call the script using this

      Information

      Hope this helps it worked for me…..

  3. Steve says:

    The href didnt show up, so I’ll try again….add the at each end

    a href=”#” onclick=”open_email(’mailto:info@stevenblainemusic.com’);”>
    Information</a

  4. I think i just had a light bulb appear over my head thanks to your blog. lol good job.

Leave a Reply