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

L

Larry Rebich

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
 
G

Guest

Larry Rebich said:
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:[email protected]">
<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 protected]">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:[email protected]');</script>"
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top