MailTo behind Button - Run at Server - Does not Launch Email Client

Discussion in 'ASP .Net' started by Larry Rebich, Nov 19, 2006.

  1. Larry Rebich

    Larry Rebich Guest

    I'm trying to launch the user's email client [Outlook, Outlook Express,
    Notes, etc.] using 'MailTo:'. So I put a button on an aspx page and wrote
    some .vb code to use 'Mailto:' and it works on my development machine when I
    press the button.

    But when I publish the site to our server, pressing the button does not
    launch the email client on the user's computer.

    Is there a way - some code - that I can launch the user's email client using
    MailTo?

    Thanks
    Larry Rebich
    Larry Rebich, Nov 19, 2006
    #1
    1. Advertising

  2. RE: MailTo behind Button - Run at Server - Does not Launch Email Clien

    "Larry Rebich" wrote:
    > I'm trying to launch the user's email client [Outlook, Outlook Express,
    > Notes, etc.] using 'MailTo:'. So I put a button on an aspx page and wrote
    > some .vb code to use 'Mailto:' and it works on my development machine when I
    > press the button.


    If it has to be a button you could use:

    <form action="mailto:">
    <input type="submit" value="Send Email">
    </form>

    But this creates a security dialog.

    You're better off using a hyperlink instead:

    <a href="mailto:">Email me</a>

    But if you have to do it in code you could use a literal control on the page
    and populate it when required on a postback with some javascript to open an
    email:

    litOpenEmail.Text = "<script language=""javascript""
    type=""text/javascript"">window.open('mailto:');</script>"
    =?Utf-8?B?TGVvbiBNYXluZQ==?=, Nov 20, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joriz

    Mailto in Code behind

    Joriz, Oct 23, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,534
    Joriz
    Oct 25, 2004
  2. Robert Dodier
    Replies:
    6
    Views:
    2,354
    Matthias Kraft
    Sep 14, 2004
  3. Paul
    Replies:
    1
    Views:
    519
  4. Thom Little

    Code Behind Mailto

    Thom Little, Jul 28, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    464
    Thom Little
    Jul 28, 2004
  5. Thomas Gagne
    Replies:
    2
    Views:
    320
    Robert Klemme
    Mar 15, 2013
Loading...

Share This Page