Solved

ASP.net VB.net open email system

Posted on 2013-10-29
2
369 Views
Last Modified: 2013-10-31
Hi

I have a button on my ASP.net web page. When a user clicks o it
I want it to open the users email  in a new email  with
a certain email address as would
happen when you click on an email address in e.g. Word
How would I achieve this?
0
Comment
Question by:murbro
2 Comments
 
LVL 32

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39609125
you should be able to do something like:

<INPUT TYPE="button" VALUE="Email" onClick="location.href='mailto:someAddress@email.com" />

if you're looking to do it through the OnClick event, you'll need to use some JS:

<form id="Form1" method="post" runat="server">
<P>Type 5 in the box and click the button</P>
<P>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox></P>
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
<P>
<asp:HyperLink id="HyperLink1" runat="server" Visible="False"
NavigateUrl="mailto:me@myplace.com">Comment</asp:HyperLink></P>
</form>
Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
If TextBox1.Text = "5" Then
Dim sb As New System.Text.StringBuilder
sb.Append("<script TYPE='text/javascript'>")
sb.Append("window.location='mailto:me@myplace.com' ;")
sb.Append("</script>")
Response.Write(sb.ToString)
End If
End Sub

Open in new window

0
 

Author Closing Comment

by:murbro
ID: 39614135
Thanks very much
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now