Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

ASP.net VB.net open email system

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
Murray Brown
Asked:
Murray Brown
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
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
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now